Free Online Articles Directory
17.11.2008 Sign In Register Hello Guest
Email:
Password:
Remember Me 
forgot your password?


Nesting Updatepanels in Asp.net 3.5

Author: Ajax Tutorials Author Ranking Blue | Posted: 12-08-2008 | Comments: 1 | Views: 217 | Rating:  (116) Article Popularity - Blue (?) Got a Question? Ask.
Sign Up Now!

In this tutorial, we will look at how we can nest UpdatePanels. You can nest as many UpdatePanels as you want- there is no limit. In this example, we will be creating two UpdatePanels and nesting one in the other. One will display a person from a database, that is selected from a DropDownMenu, the nested UpdatePanel will display the current time, so we can see when it is updated.

The first thing we will do is create a sample database - or if you have your own, you can use that. For this example, we will be using one table with a few names and cities as our data. We will need a ScriptManager, a DropDownList, a SqlDataSource, and our UpdatePanel to begin with:








DataSourceID="SqlDataSource1" DataValueField="id"
DataTextField="name" AutoPostBack="true" />
ConnectionString=""
SelectCommand="SELECT * FROM [tblPeople]" />

















We have set our DropDownList to be populated by our SqlDatSource so that the names are displayed from our database, which allows the user to select. Notice that we also set the UpdateMode of our UpdatePanel to Conditional as to only allow it to reload when the DropDownList is selected, which is identified with the trigger we added.
Next, we will add a FormView Control into the ContentTemplate of the UpdatePanel, and another UpdatePanel - this one will display the time:








DataSourceID="SqlDataSource1" DataValueField="id"
DataTextField="name" AutoPostBack="true" />
ConnectionString=""
SelectCommand="SELECT * FROM [tblPeople]" />













Person
Name:

City:








Current Time:











We now have added the FormView Control to display the selected person to the user, but currently won't do this as it does not know which person we select as yet. Notice that we have a button in the second UpdatePanel to refresh the current time. This is to demonstrate that we can reload just the nested UpdatePanel, using the trigger we hijack the attempt at postback, and instead, just reload the UpdatePanel.
To let the FormView know which item from the DropDown we select, we will add another SqlDataSource for it to look up the data:

Please follow the link to ajaxtutorials.com to continue with the tutorial and code. Happy Coding!

Rate this Article: Current: 1 / 5 stars - 3 vote(s).

Article Tags: Ajax, Nesting, Asp.net 3.5

Article Source: http://www.articlesbase.com/programming-articles/nesting-updatepanels-in-aspnet-35-519005.html

Print this Article Print article   Email to a Friend Send to friend   Publish this Article on your Website Publish this Article   Send Author Feedback Author feedback  
Ajax TutorialsAbout the Author:
Submitting articles has become one of the most popular means to drive traffic to your website and promote yourself and your business. Join us today - It's Free!

Article Comments

Comment on this article Comment on this article
Your Name
Your Email:
Comment Body
Enter Validation Code: Captcha

0
1. Nirbhay (13:21, 02.09.2008)
good

Related Articles


By: | 31/12/1969 |

Rich Internet Applications (ria)
By: Max J. Pucher | 22/03/2008 | Information Technology
The all-new hype is Rich Internet Applications (RIA). Adobe is touting Flash FLEX functionality as the next big thing in RIA. Papyrus EYE makes the development of completely dynamic user frontends in the browser much easier than Flex.

Installing Ajax Toolkit for Visual Studio .net 2005
By: Programminghelp.com | 08/08/2008 | Programming
In this article I will explain how you can integrate the AJAX framework into a web site and very easily create an AJAX enabled web site within Visual Studio 2005 utilizing C#.

The Web 2.0 Effect: the Characteristics of a Web2.0 Website
By: M.Markell | 05/02/2007 | Networks
The term web2.0 was originally presented by O'Reilly Media (A well known media company publishing books and websites on various computer technology topics). It's a term that refers to a new generation of websites (social networking websites, wiki-based websites etc). These websites take advantage of web application technologies and give web users the ability to collaborate and share their experiences, views, opinions and interests while they surf the web.

Finding a Website for Hot Source of CSS Information?
By: Walloon Brabant | 09/04/2008 | SEO
For web developers, getting a web development platform that would be catering a new web experience is their dream. Before, websites are designed in an old fashion way of text, images and plug-ins. As the internet experience evolved, it becomes more complicated that the usual HTML program could not cater it anymore. While plug-ins like Flash objects have redefined the web experience, nevertheless, has also its own downfall and that is readability.

Creating a Simple Ajax Control in Asp.net 2.0 and C#
By: Programminghelp.com | 08/08/2008 | Programming
In this article I will explain how you can easily create an AJAX enabled web site within Visual Studio 2005 utilizing C# and how to utilize the AJAX framework to add a simple control from the list of controls available in the AJAX Control Toolkit.

What is the Ajax Enabled Google Tool-kit?
By: Munish Dev Rathee | 22/02/2007 | Internet
Here is how these individual technologies play a role in AJAX: • XHTML (or HTML) and CSS are used for mark up and styling information. • The DOM (Document Object Model) is employed for the actual interaction that happens with the information that is presented. • The exchange of data asynchronously with the web server happens with the use of XMLHttpRequest. Although there are many cases where an IFrame object is used in its place. • Even though even preformatted HTML would work, XML is the forma

Your One Stop for CSS Information
By: Walloon Brabant | 09/04/2008 | SEO
CSS has become a new platform in developing website nowadays. The novelty of CSS has redefined the limits of the webpage viewing experience. Once can see some websites at relatively easier way and at the same time fashionably tailor fit that would totally make it irresistibly chic.

Got a Question? Ask.

Ask the community a question about this article:

Frequently Asked Questions

How can i prevent swifts nesting in the eaves of my roof?
By: Vicky | 03-10-2008
How can i prevent swifts nesting in the eaves of my roof?

What's the best performing code or script for ...
By: LAPIII | 03-08-2008
What's the best performing code or script for creating web apps?

How do I set up my own PHYSICAL DNS??
By: Reloaded | 20-07-2008
How do I set up my own PHYSICAL DNS?? I want a physical one, as in Modem, Firewall and Server, not a virtual one.

Are there any demo CDs or online tutorials for ...
By: Guitarz1970 | 18-07-2008
Are there any demo CDs or online tutorials for Pixela Image Mixer software?  (Aside from the website)  This is the software that the Sony includes with their Handycams.

Ajax Hot Water Boilers
By: ralphepinc | 01-07-2008
I would appreciate any information about fires caused by,or connected with, Ajax hot water boilers.

Firefox
By: Kibbutz | 20-06-2008
What are the advantages of the new Firefox browser (please don't get technical)?

Q&A Powered by:
Powered by Yedda 

Latest Programming Articles

Tips for Buying Software Online
By: Daniel Jowssey | 17/11/2008
Buying software online not only helps save the planet, it also has other benefits, including: * Ease and Simplicity. You can purchase software in your underwear at 4am if you really want to. Shopping online doesn’t have to be done within regular business hours, nor do you need to look your best to do it. It’s also easy to shop around for the best prices and takes less time than driving to the shops.

Mvc Design Pattern
By: TuVinhSoft .,JSC | 14/11/2008
Model-view-controller (MVC) is an architectural pattern used in software engineering. In complex computer applications that present a large amount of data to the user, a developer often wishes to separate data (model) and user interface (View) concerns, so that changes to the user interface will not affect data handling, and that the data can be reorganized without changing the user interface.

Advantages of Low Cost Contract Programmers in Freelance Programming
By: Joanna Gadel | 12/11/2008
It observed that web industry is getting tougher thus the necessity of freelance contract programmer is required for developing more effective website with flexible features. This article states the fruitful advantages of freelance programmers in contract programming.

A Guide to Cnc Kits
By: Martin Applebaum | 09/11/2008
CNC kits are a way in which to construct your CNC machine. This article will provide some information on these machines.

A Guide to Cnc Tube Bending Machines
By: Martin Applebaum | 08/11/2008
Are you familiar with a CNC tube bending machine? This article will shed some light on the main function and components of this machine.

Ways to Hire Dedicated Php Programmers
By: Jucick | 08/11/2008
It’s not at all easy to hire dedicated PHP programmers unless you know where and how to find them. Whether you need to fix, update or enhance your website you naturally want the job done quick and right.

Top 4 Reasons Why Addressing Web Accessibility is Important
By: Matt Cave | 05/11/2008
There are very high chances that web accessibility is more important to the performance of your web site than you realize. Article takes a look at the top 4 reasons why it would be important to address the issue of web accessibility.

Xlphoto Printing, the Best Choice for Banner Printing and Poster Printing
By: Vikram Kumar | 01/11/2008
Suppose, you have visited a tourist spot or a hill station; over there, you have witnessed some of the mesmerizing locations of serene nature.

More from Ajax Tutorials

Sorting Gridview Data With Ajax
By: Ajax Tutorials | 12/08/2008 | Programming
In this tutorial, we will look at how we can use the GridView Control to display data Asynchronously, and how we can sort data in real-time, using AJAX. We will simply create a sample database, but you can use your own if you have one in mind, and we will add a button and a GridView to the ASPX page. Then we will display the data upon button click and allow sorting in real-time.

Article Categories





Give Feedback

Sign up for our email newsletter

Receive updates, enter your email below