The Loader attribute of Ext. Net. Panel is used to reference the page.

Source: Internet
Author: User

The Panel uses the Loader method to call the page for content loading.
Note the following key points:

Home page:

<ext:ResourceManager ID="ResourceManager1" runat="server">    </ext:ResourceManager>    <ext:Panel ID="Panel1" runat="server" Title="Parent" Height="300" Width="500">        <Items>            <ext:Button ID="Button1" runat="server" Text="Button1" OnDirectClick="btn1_Click">            </ext:Button>                 </Items>        <Loader ID="Loader1" runat="server" Url="Child.aspx" Mode="Html" Scripts="true" />        <Buttons>            <ext:Button ID="Button2" runat="server" Text="Button2" OnDirectClick="btn2_Click" />        </Buttons>    </ext:Panel>

Background code:

protected void btn2_Click(object sender, DirectEventArgs e)        {                      Panel1.Loader.Visible = false;            Panel1.Update();        }        protected void btn1_Click(object sender, DirectEventArgs e)        {            Panel1.Loader.Visible = true;            Panel1.Update();        }

Subpage:

<ext:ResourceManager ID="ResourceManager1" runat="server" RenderScripts="None">    </ext:ResourceManager>    <ext:Panel ID="Panel2" runat="server" Title="Child" Width="300" Height="185" Frame="true">        <Items>            <ext:Label ID="Label2" runat="server" />        </Items>        <Buttons>            <ext:Button ID="btnChild" runat="server" Text="Submit [DirectEvent]">                <DirectEvents>                    <Click OnEvent="btnChild_Click" Url="Child.aspx" />                </DirectEvents>            </ext:Button>            <ext:Button ID="Button1" IDMode="Ignore" runat="server" Text="Submit [DirectMethod]">                <Listeners>                    <Click Handler="App.direct.ButtonClickChild({ url: 'Child.aspx' });" />                </Listeners>            </ext:Button>        </Buttons>    </ext:Panel>

Background code:

 protected void btnChild_Click(object sender, DirectEventArgs e)        {            this.Label2.Text = "Child [DirectEvent]: " + DateTime.Now.ToLongTimeString();            X.Msg.Alert("DirectEvent", "Child Button Clicked").Show();        }        [DirectMethod]        public void ButtonClickChild()        {            this.Label2.Text = "Child [DirectMethod]: " + DateTime.Now.ToLongTimeString();            X.Msg.Alert("DirectMethod", "Child Button Clicked").Show();        }

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.