Load AJAX Controls after page loads in ASP.NET?

Posted on 2008-11-09
Last Modified: 2012-05-05
I have a page which has several heavy user controls. These controls are on tabs that when the page first loads are hidden. I have seen pages where a piece of the page is loading when the page renders and they stated that they do this with AJAX.

I am relatively new to AJAX but was wondering how this was accomplished?

My theory was that I would create a JavaScript function that would kick off 6 requests using the Microsoft.XMLHTTP or Msxml2.XMLHTTP object and create child pages which render the code and simply pass back and dump the HTML onto the page. Is this the right way to do this? Is there a better way?

I am using the ASP.NET 3.5 framework with VB.NET as my back end.

Thanks so much for any and all assistance!!
Question by:MarcGraff
    LVL 21

    Expert Comment

    you could always try to use the aspnet ajax controls...the javascript is already completed for you...

    updatepanels are what provides partial postbacks...based upon triggers...i
    LVL 1

    Author Comment

    Thanks Silemone!

    Just a few questions,

    Will this allow the controls to kick off after the page has loaded?
    Should each user control contain a UpdatePanel with a JavaScript "__doPostBack"?
    LVL 1

    Author Comment

    Thanks Silemone!

    I have modified by code behind to read:
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If IsPostBack Then
                More code
            End If
        End Sub

    but the "More code" never fires. What have I done wrong?

    <asp:UpdatePanel ID="pnlMain" runat="server">
            ASP.NET CODE
            <asp:Button id="btnLoad" runat="server" style="visibility:hidden;" />
            <asp:AsyncPostBackTrigger ControlID="btnLoad" EventName="Unload" />

    Open in new window

    LVL 21

    Accepted Solution

    ok...try it without if isPostBack to see if anything happens...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now