Request 请求
服务器端接收浏览器发送来的数据, 不需要在 Action 方法中传入参数
Request.Querystring[]--get 请求
Request.Form[] 指 Post 请求
Request.File[] 指接收来的文件
Response 回应 -- 服务器向浏览器 (客户端) 发送信息
Response.Write()-- 向客户端 (浏览器) 发送字符串
Response.Redirect()-- 跳往其他页面
Session 会话, 数据保存在服务器中(字典)
Session[键名]= 值 -- 保存其值, 保存时间默认 20Min
Session.Abandon(), 销毁
Cookie 数据保存在浏览器中, 并在每次访问服务器时将该信息发送给服务器
Response.Cookies.add(), 服务器端将信息发送给浏览器作为 Cookie 保存
例子: new HttpCookie(Cookie 名){value = "Cookie 的信息"
Expires = DateTime.now.AddHours(5)} 传入 Cookie 时需要传入其有效时间
Request.Cookies["Cookies 的键名"].value-- 获得浏览器发送过来的 Cookie 值
Application 使用方法与 session 一样, 区别: session 是各个用户相互独立
Application 是所有用户相同
Server
Server.Transfer 转发, 将其他视图的内容转发到该视图上(地址栏内容不变)
- Server.MapPath
- Server.htmlEncode
- Server.HtmlDecode
- Server.UrlEncode
- Server.UrlDecode
来源: http://www.bubuko.com/infodetail-3325660.html