Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2007, 03:23 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default Load User Controls Asynchronously

I have a requirement to load multiple web user controls independently after a page has been loaded using ASP.NET Ajax. I have been searching in web but could not find any resources. Any help would be appreciated

thanks
 
Old October 27th, 2007, 09:52 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You could place an empty placeholder control inside an update panel on your page. Then use an ASP.NET AJAX timer to fire off a tick event shortly after the page loads (a few seconds should be enough). Then you load the user control's and put them into the placeholder control. Keep in mind however that a postback page lifecycle will not contain the user controls you loaded unless you explicitly load them in the page load handler. After an AJAX event on the page, the update panel could be redrawn with no controls in it.

-Peter
 
Old October 28th, 2007, 08:24 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi peter,

i am new to ajax.net. i have a very urgent requirement to do this.
would you please provide sample code if you have that would be appreciated.

one more thing if i put timer then does it fire automatically every second or so?
 
Old October 29th, 2007, 08:00 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Sorry, I don't any sample code for your situation.

You can set the timer to fire at some interval, and for your case you simply disable it after the first tick event so it only fires once. Otherwise, yes, it continually fires after each defined time period.

-Peter




Similar Threads
Thread Thread Starter Forum Replies Last Post
User controls dcct84 C# 2 October 28th, 2007 07:20 PM
User controls' content: Chapter 2 User Controls AGS BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 10 July 26th, 2007 05:36 AM
handling dynamic load of user controls spacky001 ASP.NET 1.0 and 1.1 Basics 1 December 16th, 2006 06:14 PM
Load User Controls at Runtime Duncan VB.NET 3 November 4th, 2005 07:05 PM
User Controls Duncan Pro VB.NET 2002/2003 2 December 1st, 2003 05:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.