asp.net response clearContent与 Response.BufferOutput缓存处理方法

asp教程.net response clearContent与 Response.BufferOutput缓存处理方法
清除缓存

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Clearing buffered output in ASP.NET</title>
      <script runat="server">
         Sub Page_Load()
            Response.Write("This content will not be seen.")
            Response.ClearContent()
            Message.Text = "Content written with <i>Response.Write</i> was cleared."
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>

        
输出缓存

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Buffering Output in ASP.NET</title>
      <script runat="server">
         Sub Page_Load()
            Response.BufferOutput = False
            Dim i As Integer
            For i = 1 To 50
               If (i > 10 And i < 30) Then
                  Response.BufferOutput = True
               Else
                  Response.BufferOutput = False
               End If
               System.Threading.Thread.Sleep(500)
               Response.Write(".")
               Message.Text &= "."

            Next
            Response.Write("<br>Done!<br>")
            Message.Text &= "<br>Done!<br>"
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>

时间: 2024-09-09 13:04:17

asp.net response clearContent与 Response.BufferOutput缓存处理方法的相关文章

ASP中Response对象的集合、属性和方法介绍

 Response对象与一个HTTP响应相响应,通过该对象的属性和方法可以控制如何将服务器的数据发送到客户端浏览器. 在ASP脚本中使用Response对象时,遵循以下语法格式: Response.集合名 Response.属性名 Response.方法名 Response对象只有一个Cookies集合,该集合的各个属性如下表:   =================示例=========================== < %@ language="vbscript" co

文件操作-ASP.NET对称解密后Response文件流下载

问题描述 ASP.NET对称解密后Response文件流下载 一个AES对称加密压缩文件用AES解密后使用MemoryStream内存文件流存放后转换为byte[]字节流数组使用Response文件流输出方式输出.压缩文件打开的时候提示文件流出错,内容一样可以查看说明解密成功了.使用FileStream保存文件无任何异常. ` 解决方案 http://www.cnblogs.com/chaoa/archive/2012/03/09/2386106.html

asp.net Response.Redirect跳出框架与打开窗口方法

asp教程.net Response.Redirect跳出框架与打开窗口方法 跳出框架大概会用到js top.location来实现. Response.Write('<script>top.location='http://www.111cn.net';</script>'); Response.Redirect 方法是在服务器端进行转向,因此,除非使用 Response.Write("<script>window.location='url';</s

javascript asp教程第七课--response属性_ASP基础

Below is a table of Response Properties along with examples and explanations. Response Properties Buffer Response.Buffer = trueAllows for the buffering of outputCacheControl Response.CacheControl="Public" Sets Cache to "Public" or &quo

javascript asp教程第七课--response属性

Below is a table of Response Properties along with examples and explanations. Response Properties Buffer Response.Buffer = true Allows for the buffering of output CacheControl Response.CacheControl="Public" Sets Cache to "Public" or &q

HTML,ASP,PHP开发语言不会被缓存方法

缓存 HTM网页 <META HTTP-EQUIV="pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:5

Asp.net禁用页面缓存的方法总结

 这篇文章主要介绍了Asp.net禁用页面缓存的方法,需要的朋友可以参考下 1.在Asp页面首部<head>加入      代码如下:   Response.Buffer   =   True       Response.ExpiresAbsolute   =   Now()   -   1       Response.Expires   =   0       Response.CacheControl   =   "no-cache"       Response.

Asp.net清空cache禁用页面缓存的方法

 方法1.在Asp页面首部<head>中添加如下代码        Response.Buffer   =   True      Response.ExpiresAbsolute   =   Now()   -   1      Response.Expires   =   0      Response.CacheControl   =   "no-cache"      Response.AddHeader   "Pragma",   "

在(ASP/PHP/JSP/html/js)中禁止ajax缓存的方法集锦_AJAX相关

ajax缓存有好处,但也有坏处,缓存有时候会导致误操作,影响用户体验,若你的WEB项目不需要ajax缓存功能,可按下述方法来禁止ajax缓存. 一.在ASP中禁止ajax缓存: '放在ASP网页最开头部分  Response.expires=0 Response.addHeader("pragma","no-cache") Response.addHeader("Cache-Control","no-cache, must-revali