Introduction:
In the previous section we outlined the ASP.net AJAX framework, and we explored how to download and install the framework, with an overview of the UpdatePanel controls. Drag the UpdatePanel control to the page, Then put the controls to participate in local return into the UpdatePanel control, you can easily create an interactive user interface. Any postback triggered by a control within the UpdatePanel will be converted to a local page postback. Similar to full-page return, local return sends a request to the server, Instead of client-side scripting. In addition, only the encoding of these areas is returned in the HTTP response on the page, and is updated via JavaScript. In short, local pages make the page look more refreshing. Less code interaction between client and server, and smoother page updates There is no ordinary return of the occasional flicker phenomenon.
The UpdatePanel control we examine in Part 1 is simply too simple to contain only a label and Button control. In this paper, we will be closer to the actual study of the UpdatePanel control, more in-depth study of its properties. Specifically, first we will Use the GridView control in UpdatePanel, and then we'll look at a page that contains multiple UpdatePanel controls, explaining the UpdateMode of UpdatePanel controls, Childrenastrigger, And the effect of triggers properties.
Using the GridView control in UpdatePanel
The advantage of using the UpdatePanel control is that it can create a user interface with AJAX capabilities. In real life, the user interface may contain data Web controls, such as the GridView. When placed in a UpdatePanel control, all of its features-such as paging, sorting, editing, deleting-can be used without the need to write additional code.
In the download code, there is an instance where a GridView control is placed inside the UpdatePanel control, which supports editing, deleting, sorting, paging, and so on. To create such a page, you only need to add ScriptManager and UpdatePanel controls to the page ; Next, add a GridView control to the UpdatePanel control. At this point, you can set it up as usual, you can bind it to a common data source control (declarative) and enable paging, sorting, editing, and deletion in its smart tag. A thorough elaboration of the GridView control's editing, deletion, paging, and sorting is beyond the scope of this article, and for more information on this, see the article
"Working with Data in asp.net 2.0" (http://asp.net/learn/data%2Daccess)
After you have finished setting up the GridView control, test in the browser. Because the GridView control is placed in the UpdatePanel, it will normally trigger an entire page return operation--such as going to the next page, sorting, editing, deleting, and so on, only triggering a local postback. The user interface looks much fresher.