Load AJAX Controls after page loads in ASP.NET?

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!!
Who is Participating?
silemoneConnect With a Mentor Commented:
ok...try it without if isPostBack to see if anything happens...
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
MarcGraffAuthor Commented:
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"?
MarcGraffAuthor Commented:
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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.