How to display the progress bar in ASP?

Source: Internet
Author: User

Response. buffer = true

'Application caching technology.

Dim lostnum

'Prevent dmax from being too large and dstep from being too small.

Dim shownum

Delayshow (dstep, dmax)

Sub delayshow (dstep, dmax)

'Dmax indicates the number of dmax (Steps) to be processed before the entire process can be completed. dstep indicates the approximate percentage of processed dmax (Steps) to the whole process.

Dim total

'Show all images.

Dim dtemp

'Transition variable.

Total = 100

Dtemp = dstep

Dstep = dstep + lostnum

If (dstep * total)/dmax <1 then

'The image is not painted when the screen is not connected to 1%, and the variable lostnum is used to store the total number of unpainted images, so that you can continue the next call to this process.

Lostnum = lostnum + dtemp

Else

For ccc = 1 to fix (dstep * total)/dmax)

'Get integer.

Response. Flush

Shownum = shownum + fix (dstep * total)/dmax)

Lostnum = 0

'Display the cached image. The variable shownum is used to store the currently painted image.

End if

End sub

Sub showlost ()

For ccc = 1 to (100-shownum)

Response. Write (" ")

'If the remainder cannot be painted 100 times, showlost () will display the remaining unpainted items as processed.

Next

Response. Write "<BR>"

Response. Flush

End sub

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.