문제

I am working on an ASP website. Users clicks on View details button to go to View details page.

It takes long time to connect to DB and fetch all the details from the tables.

The page is in hung/froze state for a long time and then displays the details.

I want to show a progress bar or a message saying "data is still loading" to the user before the data is displayed.

Page1: MainPage.asp page
<form action="ViewDetails.asp" method="POST">

<input type="Submit" name="Submitbutton" value="View Details">

Page 2: ViewDetails.asp 
Code to view details goes here.

How to display a progress bar in ASP website when the data is being fetched in the background?

The progress bar should disappear after the data is being loaded. Is there any options to display a progress bar in ASP code? Any suggestions on this would be helpful.

Thanks Ashok

도움이 되었습니까?

해결책

Assuming you have multiple database calls being made and lots of data being returned..

With response.buffer=true, the server side code must complete before IIS starts to send any of the HTML content for your page to the browser. You may wish to set response.buffer=false so that IIS at least starts sending HTML to the browser before it has finished processing to improve the perceived performance of the page, albeit not improving the actual performance.

A better solution, however, would be to consider utilising a client side Javascript framework such as KnockoutJS (http://knockoutjs.com/). To utilise this, you would first serve up using Classic ASP a basic page with KnockoutJS bindings, then have KnockoutJS make a subsequent server request to a different Classic ASP page to retrieve the data in a JSON format.

To simplify the output of data from Classic ASP in a JSON format, consider using a pre-made solution such as ASPJSON (https://code.google.com/p/aspjson/).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top