这是我所拥有的。我正在尝试使用 Developer Express ASPxPageControl。我只想在加载页面时加载第一个 TabPage(及其包含的 WebUserControl),然后当我单击后续选项卡时加载这些 WebUserControl。我找到了文档here和其他地方告诉我
set the ASPxPageControl.AutoPostBack property to false, and ASPxPageControl.EnableCallBacks set to true
但是,这对我不起作用。我已经使用调试器验证,当加载主页时,我的每个 WebUserControls 也会加载。我是否误解了 ASPxPageControl 的想法??
<dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0"
EnableCallBacks="True"
AutoPostBack="false" >
<TabPages>
<dxtc:TabPage Text="Detail" Name="tabDetail">
<ContentCollection>
<dxw:ContentControl ID="ContentControl3" runat="server">
<uc13:WUCDetail ID="WUCDetail" runat="server" />
</dxw:ContentControl>
</ContentCollection>
</dxtc:TabPage>
<dxtc:TabPage Text="Room" Name="tabRoom">
<ContentCollection>
<dxw:ContentControl ID="ContentControl4" runat="server">
<uc11:WUCRoom ID="WUCRoom" runat="server" />
</dxw:ContentControl>
</ContentCollection>
</dxtc:TabPage>
<dxtc:TabPage Text="Mailers" Name="tabMailers">
<ContentCollection>
<dxw:ContentControl ID="ContentControl5" runat="server">
<uc10:WUCMailers ID="WUCMailers" runat="server" />
</dxw:ContentControl>
</ContentCollection>
</dxtc:TabPage>
</TabPages>
</dxtc:ASPxPageControl>
最佳答案
However, this is not working for me. I have verified with the debugger that when the main page is loaded, each of my WebUserControls are also loading. Am I misunderstanding the idea of the ASPxPageControl??
恐怕您误解了示例"How to create and load an active tab's content on a callback"的想法。此示例的主要思想是在回调上创建并加载事件选项卡的内容。 但是您已直接在标记中指定了所有页面的内容。因此,在任何情况下都会创建并加载这些控件。请创建一个空标签页,然后使用本示例中演示的方法仅在事件标签更改时创建和加载页面内容。
关于c# - 我在这个 ASPxPageControl 中做错了什么? (开发快报),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10235228/