AJAX BalloonPopUp导致ASP.NET中的页面重新加载



我已经使用模态弹出式扩展器很长时间了。我知道我需要把弹出控制面板内的更新面板,以避免页面重新加载。这是我第一次使用气球弹出式。我使用了与ModalPopUp相同的方法,但单击目标按钮仍然会导致页面重新加载。

这是我的代码为弹出扩展程序和目标ID:

<asp:ImageButton ID="B_HELP_SFtolerance" runat="server" BorderColor="Black" 
 BorderStyle="Solid" Height="21px" ImageUrl="~/Resources/1401344600_info6.png" 
 ToolTip="Scale Factor Tolerance Info." Width="25px" />

<ajaxToolkit:BalloonPopupExtender ID="B_HELP_SFtolerance_BalloonPopupExtender"
 runat="server"  BalloonPopupControlID="P_HELP_SFTolerance"
    Position="TopRight" 
    BalloonStyle="Rectangle"
    BalloonSize="Large"
    CustomCssUrl="CustomStyle/BalloonPopupOvalStyle.css"
    CustomClassName="oval"
    UseShadow="true" 
    ScrollBars="Auto"
    DisplayOnMouseOver="false"
    DisplayOnFocus="false"
    DisplayOnClick="true" TargetControlID="B_HELP_SFtolerance" >
    </ajaxToolkit:BalloonPopupExtender>

这是我的代码面板PopUpControl ID:

 <asp:Panel ID="P_HELP_SFTolerance" runat="server" BackColor="#0000CC" 
    Height="218px" Width="404px">
 <asp:UpdatePanel ID="UP2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False" RenderMode="Inline">
  <ContentTemplate>
                Scale Factor Tolerance has a bandwidth of:<br />
                <br />
                <asp:Image ID="Image2" runat="server" Height="70px" 
                    ImageUrl="~/Resources/tolerance.png" Width="316px" />
                <br />
                <br />
                Lower Bound and Upper Bound can be changed using the textboxes 
        </ContentTemplate>
        </asp:UpdatePanel>
        </asp:Panel>

不幸的是,即使里面有更新面板,页面仍然在按钮点击后重新加载。请建议。

从你的代码中,我可以看到BalloonPopupExtenderButton都不在UpdatePanel内部。它们不应该放在UpdatePanelContentTemplate里面吗?

试试这个…

<asp:UpdatePanel ID="UP2" runat="server" RenderMode="Inline">
  <ContentTemplate>
            Scale Factor Tolerance has a bandwidth of:<br />
            <br />
            <asp:Image ID="Image2" runat="server" Height="70px" 
                ImageUrl="~/Resources/tolerance.png" Width="316px" />
            <br />
            <br />
            Lower Bound and Upper Bound can be changed using the textboxes 
<asp:ImageButton ID="B_HELP_SFtolerance" runat="server" BorderColor="Black" 
 BorderStyle="Solid" Height="21px" ImageUrl="~/Resources/1401344600_info6.png" 
 ToolTip="Scale Factor Tolerance Info." Width="25px" />

<ajaxToolkit:BalloonPopupExtender ID="B_HELP_SFtolerance_BalloonPopupExtender"
 runat="server"  BalloonPopupControlID="P_HELP_SFTolerance"
    Position="TopRight" 
    BalloonStyle="Rectangle"
    BalloonSize="Large"
    CustomCssUrl="CustomStyle/BalloonPopupOvalStyle.css"
    CustomClassName="oval"
    UseShadow="true" 
    ScrollBars="Auto"
    DisplayOnMouseOver="false"
    DisplayOnFocus="false"
    DisplayOnClick="true" TargetControlID="B_HELP_SFtolerance" >
    </ajaxToolkit:BalloonPopupExtender>
    </ContentTemplate>
    </asp:UpdatePanel>

相关内容

  • 没有找到相关文章

最新更新