Tips and Tricks: ASP.NET AJAX 1.0 and User Controls
page 1 of 10
Published: 05 Jun 2007
In this article Bilal Haidar will explore with you the different ways in which you can integrate ASP.NET AJAX 1.0 UpdatePanels into your Web application that makes extensive use of UserControls.
by Bilal Haidar
Average Rating: 
Views (Total / Last 10 Days): 51524/ 90


Recently, I have started working on the ASP.NET AJAX 1.0 add-on and so many questions were coming to my mind on the best practices to apply when adding the AJAX taste into currently existing Web applications or even with the new ones.

Using the server-side part of the AJAX 1.0 library, which includes the ScriptManager, UpdatePanel, Timer, and UpdateProgess controls, is straight forward and a matter of just dragging these controls onto the page and that is it! However, it is not always that easy and clear when it comes with working with MasterPages and AJAX or User Controls and AJAX.

In this article we are going to illustrate to you several ways on how you can use the UpdatePanel together with user controls, whether to include UpdatePanel within the UserControl itself or simply embed a UserControl inside an UpdatePanel on the host page.

We will start by developing a simple ASP.NET Web application in which we have two UserControls, mainly the EmployeeList and OrderList UserControls, with the old post-back model. After that we explore the different ways of adding AJAX into the application.

In a future article, hopefully, we will illustrate the best practices on how to use the AJAX 1.0 library with the MasterPages in ASP.NET 2.0.

View Entire Article

User Comments

Title: very nice   
Name: Serif Emek
Date: 2009-07-28 5:32:09 PM
That is just what I was looking for.
Title: Re: Vbman   
Name: Bilal Haidar [MVP]
Date: 2008-03-27 10:38:17 AM
Try to show me the code behind of the usercontrol and how you are setting it on the page!

Title: Object reference not set to an instance of an object.   
Name: Vbman
Date: 2008-03-27 10:05:40 AM
Great Article!
I have the update panel on the page and the user controls inside the update panel.
I create a property inside the usercontrol that accesses a control, Say the gridviews Tooltip or Pagesize or ...
When I try to set the property on page declaratively I get an error:
Object reference not set to an instance of an object.

I've seen this problem posted in other places but no solution.
Have you run into this and do you have a work around.

Title: Re:   
Name: Bilal Haidar
Date: 2007-10-30 10:43:12 AM
You can use this converter:

Title: VB.Net   
Name: Jo
Date: 2007-10-30 5:51:05 AM
Article is so good. If it is available in also it will be helpful for the beginners.
Title: Well explained   
Name: Jose
Date: 2007-08-09 4:44:16 AM
As usual, you did a great job!

I loved the fact that you showed all the possible combinations you can have with a gridview user control and AJAX. And the sample works really fine!

Title: Great   
Name: Mark W
Date: 2007-06-25 9:24:07 PM
Very well summarized, thanks. I agree, good use of events and generics.

Also, there's a small typo in Listing 5: OrderList UC's UpdatePanel ID should be 'AjaxPanel'.
Title: Nice one   
Name: Wesley Bakker
Date: 2007-06-24 4:32:51 AM
Nice article. Decent use of events, AJAX, generics, datasourcecontrols etc. etc.


Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-15 10:11:24 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search