The UpdatePanel is one of the controls of Atlas that enables the adding of selective Atlas functionality to existing Web applications. For this example, we will start by building an ASP 2.0 application. With that application we then add the most common Ajax functionality to the page – the partial page update.
Note: If you haven’t installed the latest Atlas build it can be found here
The Standard Web Application
- Start by creating a new ASP.NET Web Application
- Place a button and text box on the form
- Double click the button and add the following code
- Run the application. As you click the button notice that the page is doing a post back each time. Of course this is standard ASP.NET behavior
Adding Atlas Functionality
Now that we have built a standard ASP.NET application we can add partial the partial page update feature of Atlas functionality to the application.
- Drag the UpdatePanel control onto the form. Once added to the form this will also bring in the Microsoft.Web.Atlas.dll into your project.
- Add a Script Manager control to the page
- Enable Partial Rendering.
- Drag the label into the UpdatePanel Control
- Select the UpdatePanel properties and select Triggers
- Select a trigger that occurs when the click event is raised by the button.
- Once you run the application you will notice that the post back is gone.