2

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

1 回答 1

2

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.

于 2012-04-20T04:23:12.883 回答