ASP example: ASP to prevent frequent Web page refresh one method

Source: Internet
Author: User
Refresh | Web Page The following example code is to prevent the use of Web pages to refresh too quickly, if more than one page use, it is best to save <%...%> code as an ASP file, in the need for the first page include file use.
<%
Dim refreshintervaltime
Refreshintervaltime = 3 ' Prevents refresh time seconds, 0 means not preventing
If Not IsEmpty (sessions ("visit")) and IsNumeric (session ("visit")) and int (refreshintervaltime) > 0 Then
if (Timer ()-int (Session ("visit")) *1000 < Refreshintervaltime * 1000 Then
Response.Write ("<meta http-equiv=" "Refresh" "Content=" "& Refreshintervaltime &" "/>")
Response.Write ("Refresh too fast, please wait")
Session ("visit") = Timer ()
Response.End
End If
End If
Session ("visit") = Timer ()
%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title>asp prevents frequent web pages from refreshing a method-webjx.com</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<link rel= "stylesheet" type= "Text/css" href= "Style.css" >
<style type= "Text/css" >
</style>
<body style= "Background-color: #666666; font-size:36pt;font-family: blackbody; color: #FFFFFF;" >
Page content, page content
</body>

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.