What am I doing wrong in this ASPxPageControl? (dev express)

那年仲夏 提交于 2019-12-22 14:04:14

问题


Here is what I have. I am trying to use Developer Express ASPxPageControl. I want to only load the first TabPage (and WebUserControl it contains) when the page is loaded and then when I click on subsequent tabs, load those WebUserControls. I have found documentation here and other places telling me to

set the ASPxPageControl.AutoPostBack property to false, and ASPxPageControl.EnableCallBacks set to true

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??

<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>

回答1:


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??

I'm afraid you are misunderstanding the idea of the example "How to create and load an active tab's content on a callback". The main idea of this example is to create and load an active tab's content on a callback. But you've specified content for all pages directly in markup. Thus these controls will be created and loaded in any cases. Please, create an empty tabpages and then use the approach demonstrated in this example to create and load page's content only when active tab changed.



来源:https://stackoverflow.com/questions/10235228/what-am-i-doing-wrong-in-this-aspxpagecontrol-dev-express

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!