我已经使用模态弹出式扩展器很长时间了。我知道我需要把弹出控制面板内的更新面板,以避免页面重新加载。这是我第一次使用气球弹出式。我使用了与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>