Building an interactive user interface with Microsoft asp.net Ajax Technology-part 2

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.