Response.AddHeader使用实例
1.文件下载,指定默认名
Response.AddHeader("content-type","application/x-msdownload"); // 限制类型
Response.AddHeader("Content-Disposition","attachment;filename=文件名.rar");// 下载后的文件名
2.刷新页面
Response.AddHeader (“REFRESH”, ”60;URL=newpath/newpage.asp”)
这等同于客户机端<META>元素:
<META HTTP-EQUIV=”REFRESH”, “60;URL=newpath/newpage.asp”>
3.页面转向
Response.Status = “302 Object Moved”
Response.Addheader “Location”, “newpath/newpage.asp”
这等同于使用Response.Redirect方法:
Response.Redirect “newpath/newpage.asp”
4.强制浏览器显示一个用户名/口令对话框
Response.Status= “401 Unauthorized”
Response.Addheader “WWW-Authenticate”, “BASIC”
强制浏览器显示一个用户名/口令对话框,然后使用BASIC验证把它们发送回服务器(将在本书后续部分看到验证方法)。
5.如何让网页不缓冲
Response.Expires = 0
Response.ExpiresAbsolute = Now() - 1
Response.Addheader "pragma","no-cache"
Response.Addheader "cache-control","private"
Response.CacheControl = "no-cache
Response.AddHeader使用实例的更多相关文章
- Response.AddHeader
Response.AddHeader使用实例 1.文件下载,指定默认名 Response.AddHeader("content-type","application/x- ...
- [转]Response.AddHeader 文本下载
本文转自:http://hi.baidu.com/yuxi981/item/7c617fc41b03ad60f6c95d30 Response.AddHeader实现下载 /// <su ...
- Response.AddHeader小结
(一)文件下载,指定默认名 Response.AddHeader("content-type","application/x-msdownload"); Res ...
- C#中解决Response.AddHeader("Content-Disposition", "attachment; filename=" + filename)下载文件时文件名乱码的问题
问题:下载文件时文件名乱码怎么解决? 在C#写后台代码过程中,经常遇到下载文件出现文件名乱码的问题,在网上找了很多方法,总是存在浏览器不兼容的问题,当IE浏览器不乱码时,火狐浏览器就会乱码,后来经过反 ...
- 关于使用response.addHeader下载中文名乱码问题
介绍下我项目中遇到的问题:在数据库导出Excel文件的过程中,导出文件中文名始终异常,最终结果发现需要在response.addHeader 中的 filename = "xxxx" ...
- 解决Response.AddHeader中文乱码问题
string filename = HttpUtility.UrlEncode(Encoding.UTF8.GetBytes("培训班自然情况表")); Response.AddH ...
- 【转】解决response.AddHeader("Content-Disposition", "attachment; fileName=" + fileName) 中文显示乱码
如果fileName为中文则乱码.解决办法是 方法1: response.setHeader("Content-Disposition", "attachment; fi ...
- 解决Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name) 中文显示乱码
如果file.Name为中文则乱码.解决办法是方法1:response.setHeader("Content-Disposition", "attachment; fil ...
- Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name) 中文显示乱码
如果file.Name为中文则乱码.解决办法是方法1:response.setHeader("Content-Disposition", "attachment; fil ...
随机推荐
- uva 1210
#include<iostream> #include<cstring> using namespace std; + ; bool notprime[MAXN];//值为fa ...
- 自定义圆的半径attr.xml
<?xml version="1.0" encoding="utf-8"?><resources> <declare-sty ...
- MSP430G2553之timerA产生PWM
总结:选SMCLK(可以测出来) 若选ACLK,经示波器PWM时有时无 举例一: #include <MSP430G2553.h> #define CPU_F ((doub ...
- SimpleDateFormat格式化日期
SimpleDateFormat格式化日期 import java.text.SimpleDateFormat;import java.util.Date;public class test { pu ...
- Jquery中的prop()方法 全选或全不选
注意: prop()在高版本才会有效, 低版本用attr(); $(function(){ // 元素checkbox var aChecked = $('.checkGoods'); // 全选 v ...
- (转)HTML5开发学习(2):本地存储之localStorage 、sessionStorage、globalStorage
原文:http://www.cnblogs.com/xumingxiang/archive/2012/03/25/2416386.html HTML5开发学习(2):本地存储之localStorage ...
- 12-27cell常用的属性
1.创建cell // 创建一个cell并且设置cell的风格 UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UI ...
- C++11 move_iterator
template<typename Iterator> class move_iterator { Iterator current; public: typedef Iterator i ...
- 多动手试试,其实List类型的变量在页面上取到的值可以直接赋值给一个js的Array数组变量
多动手试试,其实List类型的变量在页面上取到的值可以直接赋值给一个js的Array数组变量,并且数组变量可以直接取到每一个元素var array1 = '<%=yearList =>'; ...
- Python的"数组"储存
import time member=["小甲鱼","小布丁","黑夜","迷途","伊静"] pr ...