Updateprogress is very simple to use, but it is very useful. The following describes how to use updateprogress first:
<1>. Add an updatepanel to the page and put a label and a button in it.
<2> Add an updateprogress control and set its associatedupdatepanelid attribute to the name of the above updatepanel.
<3> switch to the "Source" view and edit the updateprogress progresstemplate node:
<Asp: updateprogress associatedupdatepanelid = "upinq" id = "upgcuser" runat = "server">
<Progresstemplate>
<span style = "color: # ff0000 "> retrieving data </span>
</Progresstemplate>
</ASP: updateprogress>
<4> set the Click Event code of the button:
System. Threading. thread. Sleep (4000 );
<5> okay. Run the project. click the button and you will find a small rotating icon (depending on your image, of course), and a string of Red words: retrieving data. Four seconds later, automatically disappears.
It should be noted that images are not necessarily needed, and only texts are allowed. The content between progresstemplate can be edited at will and can be any element. in addition, the default value of the displayafter attribute is 500, which is a suitable value and is not recommended to be modified. this is the wait time in milliseconds. When the wait time is exceeded, it is displayed. When updatepanel is updated, it is hidden. therefore, if you set this time too short, you will see the updateprogress flash every time, which will greatly affect the user experience.
If it is a LAN application, the server will always return quickly and there is no need to use this control.