[CLOSED] [1.0] How to load a page inside a tabpanel dynamically.

  1. #1

    [CLOSED] [1.0] How to load a page inside a tabpanel dynamically.

    Hi,

    Im trying to load an aspx inside a TabPanel. My Scenario is,

    I have a page which contains an user control and a Tabpanel. The tabpanel has some 15 tab items in it. Each tab has it own aspx page.

    Based on the selection of the records from the user control, im changing the records in the aspx page of the active tab in the tabpanel.

    In Coolite 0.8.1 we are using the following code to load the page for the active tab..
    MainTabPanel.ActiveTab.LoadContent(MainTabPanel.ActiveTab.AutoLoad.Url)
    But after changing to Coolite 1.0, Im getting an error in the above code.

    Can u tell us, what change i have to do in order to reload the page in the active tab.
  2. #2

    RE: [CLOSED] [1.0] How to load a page inside a tabpanel dynamically.

    Hello, Hari_CSC.

    Please look at the example.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="How to load a page inside a tabpanel.aspx.cs"
        Inherits="Work.Premium_help.How_to_load_a_page_inside_a_tabpanel" %>
    
    <script runat="server">
        protected void Button_Click(object sender, DirectEventArgs e)
        {
            ((PanelBase)TabPanel1.ActiveTab).LoadContent(((PanelBase)TabPanel1.ActiveTab).AutoLoad.Url);
            //((PanelBase)TabPanel1.ActiveTab).LoadContent(new LoadConfig("http://google.com", LoadMode.IFrame)); // using LoadContent with LoadConfig argument
            //((PanelBase)TabPanel1.ActiveTab).Reload(); //to reload the content of the ActiveTab
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Panel runat="server" Layout="border" Height="500">
            <Items>
                <ext:MenuPanel ID="MenuPanel1" runat="server" Width="200" Region="West">
                    <Menu ID="Menu1" runat="server">
                        <Items>
                            <ext:MenuItem ID="MenuItem1" runat="server" Text="LoadContent()" Icon="Accept">
                                <DirectEvents>
                                    <Click OnEvent="Button_Click" />
                                </DirectEvents>
                            </ext:MenuItem>
                        </Items>
                    </Menu>
                </ext:MenuPanel>
                <ext:TabPanel ID="TabPanel1" runat="server" Region="Center">
                    <Items>
                        <ext:Panel runat="server" Title="Panel 1">
                            <AutoLoad Url="http://rambler.com" Mode="IFrame">
                            </AutoLoad>
                        </ext:Panel>
                        <ext:Panel runat="server" Title="Panel 2">
                            <AutoLoad Url="http://google.com" Mode="IFrame">
                            </AutoLoad>
                        </ext:Panel>
                    </Items>
                </ext:TabPanel>
            </Items>
        </ext:Panel>
        </form>
    </body>
    </html>
    Please cast TabPanel1.ActiveTab() to the PanelBase class to access to the LoadContent() method. Also you have to use Mode="IFrame" in the AutoLoad.

    Please note that you can use the Reload() method if you want to reload a content of ActiveTab.

    Also there is an example of using the LoadContent method with LoadConfig argument in the code above (in the comment line of the Button_Click method)
  3. #3

    RE: [CLOSED] [1.0] How to load a page inside a tabpanel dynamically.

    Hi Daniil,

    thanks for the sample.. It is working great...

  4. #4

    RE: [CLOSED] [1.0] How to load a page inside a tabpanel dynamically.

    It's nice to help you:)

Similar Threads

  1. Replies: 1
    Last Post: May 18, 2012, 1:52 PM
  2. [CLOSED] TabPanel - perform page load only when active
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 09, 2012, 4:48 PM
  3. Replies: 6
    Last Post: Nov 04, 2010, 10:14 AM
  4. Replies: 1
    Last Post: Nov 03, 2010, 7:31 PM
  5. Replies: 13
    Last Post: Feb 24, 2010, 5:34 PM

Posting Permissions