DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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.

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links