我已经使用Modal PopUp Extender很久了。我知道我需要将“弹出窗口控制面板”放在“更新面板”中,以避免重新加载页面。这是我第一次使用气球弹出。我使用了与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>
不幸的是,即使内部装有更新面板,单击按钮后页面仍会重新加载。请指教。提前致谢。
最佳答案
从您的代码中,我可以看到BalloonPopupExtender
和Button
都不在UpdatePanel
内部。它们不应该放在UpdatePanel
的ContentTemplate
中吗?
尝试这个...
<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>