This tutorial will show you how to create an ASP.NET Page with Multiple UpdatePanel Controls C#
In this tutorial we will demonstrate how to work with multiple UpdatePanel controls on a page. By adding multiple UpdatePanel controls onto a page you are able to update regions of the page separately or together. This is considered a partial page update.
Here is a snapshot of what the Final Page will look like:
If you're looking for a really good web host, try Server Intellect - we found the setup procedure and control panel, very easy to adapt to and their IT team is awesome!
To start open Visual Studio 2008. File > New > Web Site > and name it MultUpPanels or whatever you want. Then switch to Design view.
Within the AJAX Extensions tab of the toolbox, simply double –click the ScriptManager control to add it to the page. Then double-click the UpdatePanel control in the toolbox twice to add two UpdatePanel controls to the page. In the properties window, set both UpdateMode controls of both UpdatePanel controls to conditional.
In the first UpdatePanel control, add a Label control and set its Text property to “Panel Created”. In the same UpdatePanel control, add a Button control and set its text property to “Refresh Panel”.
Within the second UpdatePanel add a Calendar control.
Next, double-click the “Refresh Panel” button to add an event handler for its click event. Then add this code to the handler. This simply sets the Label control to the current time.
| protected void btnButtonOne_Click(object sender, EventArgs e) { lblLabelOne.Text = "Panel refreshed: " + DateTime.Now.ToString(); } |
Save and Run. Click the Button and the time should change. Change the Month in the calendar and notice how the time does not change. You have just created to UpdatePanels on the same ASP.NET 3.5 Web page.
We chose Server Intellect for its dedicated servers, for our web hosting. They have managed to handle virtually everything for us, from start to finish. And their customer service is stellar.
This markup might be formatted a little better. Try it, if you want:
| <div> <asp:ScriptManager id="smScriptManager" runat="server"> </asp:ScriptManager> <asp:UpdatePanel id="upUpdatePaneOne" runat="server"> <ContentTemplate> <fieldset> <legend>UpdatePanel1</legend> <asp:Label ID="lblLabelOne" runat="server" Text="Panel Created"> </asp:Label> <asp:Button ID="btnButtonOne" runat="server" Text="Refresh Panel 1" OnClick="btnButtonOne_Click" /> </fieldset> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="upUpdatePaneTwo" runat="server"> <ContentTemplate> <fieldset> <legend>UpdatePanel2</legend> <asp:Calendar ID="calCalendar" runat="server"> </asp:Calendar> </fieldset> </ContentTemplate> </asp:UpdatePanel> </div> |
We moved our Web sites to Server Intellect and have found them to be incredibly professional. Their setup is very easy and we were up and running in no time.


Leave a Comment
#1 aion kinah
Posted By: aion kinah | 3.01.2010 at 12:29 AM
thanks for sharing this code.
#2 coach handbag outlet
Posted By: coach handbag outlet | 3.01.2010 at 8:43 PM
They are known for their sleek and smart
#3 discount christain louboutin
Posted By: discount christain louboutin | 3.01.2010 at 8:43 PM
You are sure to find one for every occasion.
#4 MBT trainers shoes
Posted By: MBT trainers shoes | 3.01.2010 at 8:44 PM
The variety of coach handbags are so many that it almost becomes difficult to choose the right one.
#5 cool games
Posted By: cool games | 3.07.2010 at 3:42 AM
I really liked this gorgeous blog post. Please keep them coming. Greets!!!!
#6 Chapel Hill Houses for Sale
Posted By: Chapel Hill Houses for Sale | 3.11.2010 at 4:00 AM
This is a really nice article. I am sure a lot of people will benefit from it. Thanks!
#7 25th Wedding Anniversary
Posted By: 25th Wedding Anniversary | 3.18.2010 at 1:34 AM
Thanks for sharing the information.It is definitely going to help me some time.
#8 70-290
Posted By: 70-290 | 3.18.2010 at 4:21 AM
I really liked this gorgeous blog post. Please keep them coming. Greets!!!!
#9 Towing near LasVegas
Posted By: Towing near LasVegas | 3.19.2010 at 2:24 AM
Very useful and informative article, I've already bookmark this article and I'll definitely refer this to all my close friends and colleagues. :)
#10 Towing in Phoenix
Posted By: Towing in Phoenix | 3.19.2010 at 5:00 AM
These days, it has become very rare to find articles like this. Thanks for posting! :)