webform--page Local Refresh

Source: Internet
Author: User

There are data controls that, after each change to its value, requery the database and then re-display it. So each time will refresh all the pages, if it is a lot of information is very large page, there will be a lag phenomenon, in order to avoid this situation, the use of local refresh. The controls used are: ScriptManager and UpdatePanel inside the Ajax extension .

ScriptManager is a well-encapsulated JS code that can be used directly.

UpdatePanel, part of the partial refresh is put in here.

In this picture, the province city three drop-down list is placed in the UpdatePanel inside, thus realizes the local refresh here information.

When using the UpdatePanel control, it is important to have a property!!

updatemode: Indicates whether to refresh at each asynchronous time or in a specific case.

When the value of Updarepanel is conditional, the specific part to be refreshed: updatepanel1.update (); Add this code, you want to refresh where you can refresh.

The following is the Chinese provinces and cities three linkage, only partially refresh the section of the drop-down list:

 protected voidDropDownList1_SelectedIndexChanged (Objectsender, EventArgs e) {               stringPro = DropDownList1.SelectedValue.ToString ();//Load City JurisdictionBindCity1 (Pro);//according to the selected provinces,        stringCity = DropDownList2.SelectedValue.ToString ();//Loading CityBindCity2 (city);//according to the selected municipal authority to load the city       updatepanel1.update ();//Conditional Refresh    }    protected voidDropdownlist2_selectedindexchanged (Objectsender, EventArgs e) {        stringCity = DropDownList2.SelectedValue.ToString ();//Loading CityBindCity2 (city);//according to the selected municipal authority to load the city        updatepanel1.update ();//Conditional Refresh}

webform--page Local Refresh

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.