[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Load AJAX Controls after page loads in ASP.NET?

Posted on 2008-11-09
4
Medium Priority
?
624 Views
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!!
0
Comment
Question by:MarcGraff
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:silemone
ID: 22916518
you could always try to use the aspnet ajax controls...the javascript is already completed for you...

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Tabs/Tabs.aspx 

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

Author Comment

by:MarcGraff
ID: 22916855
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"?
0
 
LVL 1

Author Comment

by:MarcGraff
ID: 22916964
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?

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

Open in new window

0
 
LVL 21

Accepted Solution

by:
silemone earned 2000 total points
ID: 22918640
ok...try it without if isPostBack to see if anything happens...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

834 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