ASP.NET避免页面重新整理时重复发送...
我们可以继承 ASP.NET 的 Page 类别,自行扩充所需的功能!作法如下:
1、继承 System.Web.UI.Page,自订一个 BasePage 类别。
以下为引用的内容:
using
System;
/// <summary>
/// BasePage 的摘要描述
/// </summary>
public
class
BasePage : System.Web.UI.Page
{
public
BasePage() { }
}
2、在 BasePage 类别底下撰写 SetActionStamp 方法,目的是在 Session 存放一个系统时间戳记。
以下为引用的内容:
/// <summary>
/// 設置戳記
/// </summary>
private
void
SetActionStamp()
{
Session[
"actionStamp"
] = Server.UrlEncode(DateTime.Now.ToString());
}
3、处理 PreRender 事件,在网页初次载入时设置戳记,且每次载入执行时会把该戳记存放到 HiddenField 里。
以下为引用的内容:
public
BasePage() {
this
.PreRender +=
new
EventHandler(Page_PreRender); }
void
Page_PreRender(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
SetActionStamp();
}
ClientScript.RegisterHiddenField(
"actionStamp"
, Session[
"actionStamp"
].ToString());
}
4、自订 IsRefresh 属性,藉由判断 HiddenField 存放的戳记是否等于 Session
裡存放的值,就可以得知网页是否经由重新整理动作回传。
以下为引用的
相关文档:
在了解HTTP断点续传的原理之前,先来说说HTTP协议,HTTP协议是一种基于tcp的简单协议,分为请求和回复两种。请求协议是由客户机(浏览器)向服务器(WEB SERVER)提交请求时发送报文的协议。回复协议是由服务器(web server),向客户机(浏览器)回复报文时的协议。请求和回复协议都由头和体组成。头和体之间以一行空行为分隔。
......
上次我们说到的编译成的dll文件与cs文件在同一目录中,而不会放到虚拟目录的bin目录中,如何做才能够把cs
文件编译成dll且自动放到虚拟目录的bin文件夹中呢?
开始-------程序-------Microsoft Visual Studio.NET 2003-------Visual Studio.NET工具,点击其中的“Visual Studio.NET2003命令提示”,就会进入Mic ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Mat ......
Request.ServerVariables["Url"]
返回服务器地址
Request.ServerVariables["Path_Info"]
客户端提供的路径信息
Request.ServerVariables["Appl_Physical_Path"]
与应用程序元数据库路径相应的物理路径
Request.ServerVariables["Path_Translated"]
通过由虚拟至物理的映射后得到的路径
Request.ServerVariables ......