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