For ASP. NET pages that have been loaded for a long time, we can display a progress bar in the client browser to show that the page is being loaded. The specific implementation process is as follows:
Create a project named WebPortal. In the project type, select Visual C # Project or Visual Basic project;
Select an ASP. NET Web application from the template type;
Enter: http: // localhost/WebPortal;
Add a new project: a Web form named ShowProgress.
Add any other Web server controls on your Web form ShowProgress. aspx.
Right-click ShowProgress. aspx, click "View code", and enter:
Visual C #. NET code using System. Threading;
Visual Basic. NET code Imports System. Threading
In the Page_Load event, enter: Visual C #. NET code Response. Write ("");
Response. Write ("_");
Response. Write ("");
Response. Write ("mydiv. innerText = '';");
Response. Write (";");
Response. Write ("var dots = 0; var dotmax = 10; function ShowWait ()");
Response. Write ("{var output; output = 'loading page'; dots ++; if (dots> = dotmax) dots = 1 ;");
Response. Write ("for (var x = 0; x <dots; x ++) {output + = '·';} mydiv. innerText = output ;}");
Response. Write ("function StartShowWait () {mydiv. style. visibility = 'visible ';");
Response. Write ("window. setInterval ('ShowWait ()', 1000 );}");
Response. Write ("function HideWait () {mydiv. style. visibility = 'did ';");
Response. Write ("window. clearInterval ();}");
Response. Write ("StartShowWait ();");
Response. Flush ();
Thread. Sleep (10000 );
Visual Basic. NET code Response. Write ("")
Response. Write ("_")
Response. Write ("")
Response. Write ("mydiv. innerText = '';")
Response. Write (";")
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.