First Asp.Net Ajax Program

Ajax introduces a new approach to WebPages that update the portion of a webpage by a techniques called Partial-page rendering. In the following example you can learn the difference between How a Partial-page rendering and a traditional way of page update works in a same web page.

The ScriptManager control is the essential core for the ASP.NET AJAX Extensions. We have to use a ScriptManager Control in just about every Ajax application. In the following example we placed a ScriptManager control , one UpdatePanel Control, two Buttons named Ajax-Button and Non-Ajax-Button and two label controls in the form.

The first Button (Ajax-Button) is placed inside the UpdatePanel control area and the second Button (Non-Ajax-Button) placed outside the UpdatePanel control area. When you run this application and clicked first button (Ajax-Button), then you can see the first label control only updated the current server time. When you clicked on second Button (Non-Ajax-Button) you can see both label control will update the current server time. This is happening because the first Button(Ajax-Button) and label control we placed inside the UpdatePanel Control area and it behaves like Partial-page rendering. That means it will update only the portion of the webpage (between UpdatePanel Control area) while clicking first Button. When you clicked on the second Button (Non-Ajax-Button) you can see both labels updated with current server time ,because second Button (Non-Ajax Button) is placed outside the UpdatePanel area and it behaves like ordinary web application and updated both labels. That means a full page refresh or full postback to the web server is happening while clicking second Button.


When you copy and paste the above Default.aspx code put the appropriate header like .. if you using c# add the following line at the top of Default.aspx

or if you r using add the following line at the top of Default.aspx

Click the following links to see full source code

C# Source Code
VB.NET Source Code
Default.aspx.vb (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About