Page Load Order


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Page Load Order

  1. #1
    Join Date
    Oct 2004
    Posts
    63

    Page Load Order

    I'm using a base class to create every page I have in my project. To build the actual page I use this code.

    protected override void OnInit(System.EventArgs e)
    {
    this.Controls.AddAt(0, LoadControl("header.ascx"));

    base.OnInit(e);

    Control c1 = LoadControl("footer.ascx");

    this.Controls.Add(c1);
    }

    The problem is, is that if I step through the code, it goes to the actual page's OnInit, then it comes to the base page and runs this override. So the contents on the page show on the top, then the header, and then the footer is added last. Why doesn't this override the OnInit on the page and run in this order? It used to, but I changed something and now I can't figure out what.

  2. #2
    Join Date
    Oct 2004
    Posts
    63
    Attention to detail. I figured it out. I left some tags out of the HTML that was putting all out of whack.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center