如何禁用由于UpdatePanel内TabContainer的activeTabChange而导致的页面刷新?
我正在使用具有以下设置的 AJAX TabContainer 控件。当我更改选项卡时,会发生回发并刷新整个页面。因为 AutoPostBack="true"> 。为了 AJAxify 行为,我在其周围添加了 UpdatePanel,但页面仍然刷新。该控件需要访问服务器,因为用户控件包含一些需要填充的网格。
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="upTLTop" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<AjaxCT:TabContainer ID="tcProducts" runat="server" ActiveTabIndex="0" Style="height: 100%;
vertical-align: top; margin: 0px; padding: 0px;" OnActiveTabChanged="Products_OnActiveTabChanged" AutoPostBack="true">
<AjaxCT:TabPanel runat="server" HeaderText="MBS" ID="pnlMBS">
<ContentTemplate>
<uc1:ucA ID="ucA1" runat="server" />
</ContentTemplate>
</AjaxCT:TabPanel>
<AjaxCT:TabPanel runat="server" HeaderText="ABS" ID="TabPanel1">
<ContentTemplate>
<uc2:ucB ID="ucB1" runat="server" />
</ContentTemplate>
</AjaxCT:TabPanel>
</AjaxCT:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
在这种情况下,如何禁用页面刷新并同时发生服务器端操作?
请指教。谢谢 阿杰
I am using AJAX TabContainer control with following settings. When I change a tab the postback happens and whole page refreshes. Because AutoPostBack="true"> . To AJAxify the behavior, I added UpdatePanel around it but still the page is refreshing. The control need to go to server because user controls contains some grids which need to be populated.
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="upTLTop" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<AjaxCT:TabContainer ID="tcProducts" runat="server" ActiveTabIndex="0" Style="height: 100%;
vertical-align: top; margin: 0px; padding: 0px;" OnActiveTabChanged="Products_OnActiveTabChanged" AutoPostBack="true">
<AjaxCT:TabPanel runat="server" HeaderText="MBS" ID="pnlMBS">
<ContentTemplate>
<uc1:ucA ID="ucA1" runat="server" />
</ContentTemplate>
</AjaxCT:TabPanel>
<AjaxCT:TabPanel runat="server" HeaderText="ABS" ID="TabPanel1">
<ContentTemplate>
<uc2:ucB ID="ucB1" runat="server" />
</ContentTemplate>
</AjaxCT:TabPanel>
</AjaxCT:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
How can I disable the page refresh and at the same time server side operation happens in this case?
Please advise. Thanks
AJ
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在更新面板上设置 ChildrenAsTriggers="True"。不过,我个人不明白你的代码为什么不能按原样工作。
Try setting ChildrenAsTriggers="True" on your update panel. Though, I personally do not see how your code does not work as is.