Display progress bar in ASP. NET
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 typeProgram;
- 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 and click "View ".Code", Enter at the top:
Visual C #. Net code Using system. Threading; <br/> Visual Basic. Net code Imports system. Threading <br/>
- In the page_load event, enter:Visual C #. Net code Response. write (""); <br/> response. write ("_"); <br/> response. write ("<p>"); <br/> response. write (""); <br/> response. write (""); <br/> response. flush (); <br/> thread. sleep (10000); <br/> Visual Basic. Net code Response. write ("") <br/> response. write ("_") <br/> response. write ("<p>") <br/> response. write ("") <br/> response. write ("") <br/> response. flush () <br/> thread. sleep (10000) <br/>
- Enter:
- Click View in the browser.