Global/重写向/Render/目录详解
来源:互联网 发布:苹果笔记本mac系统升级 编辑:程序博客网 时间:2024/05/06 11:39
Global
Application_Start //请求开始
Application_End //请求结束
Application_Error//请求错误
Application_BeginRequest//开始请求页面
Application_EndRequest//结束请求页面
Application_AuthenticateRequest
Session_Start//Session开始表示一个新用户连接 Session.Timeout=10;
Session_End//Session结束表示一个用户注销
重写向
Uriui=HttpContext.Current.Request.Url;//Context.Request.AppRelativeCurrentExecutionFilePath
Regexrg=newRegex(@"view(\d+)\.aspx");
Matchmt=rg.Match(Context.Request.Url.AbsolutePath);
if (mt.Success)
{
stringid=mt.Groups[1].Value;
Context.RewritePath(@"~\WebForm2.aspx?id="+id);//在Global
中改变请求的Url,在Load中已经不能改变请求的Url PreInit不知道行不行
Context.Response.Redirect(@"~\WebForm2.aspx?id="+id);//页面重定向,从新请求
Context.Server.Transfer(@"~\WebForm2.aspx?id="+id,true);//内部重定向,保存参数
}
目录详解
相对URL 难以移动文件。移动到另一个目录就可能断开。
基于根目录的相对URL
服务端的相对URL(虚拟路径/“虚拟应用程序”路径)必须为 runat="server"控件
绝对URL 如果引用自己站点之外的资源就必须用绝对URL
Render
protected override void Render(HtmlTextWriterwriter)
{
System.IO.StringWriterhtml=newSystem.IO.StringWriter();
System.Web.UI.HtmlTextWritertw=newSystem.Web.UI.HtmlTextWriter(html);
base.Render(tw);
Html=html.ToString();
tw.Close();
Response.Write(html.ToString());
}
- Global/重写向/Render/目录详解
- 重写Render方法
- Global.asax实现URL重写
- IPicture::Render参数详解
- 重写 Render 控制页面内容输出
- 重写Page类的Render方法
- Surround360 Render目录下RENDER文档——中文翻译
- Ext render 详解
- 重写向&转发
- Global.asax详解
- Global.asax详解
- Global.asax详解
- Global.asax详解 (转)
- Global.ascx详解
- Global.asax详解
- Global.asax详解
- Global.asax详解
- php global 详解
- 谈一下我对于指针的理解 .
- 问题集锦
- 二重指针
- 惠普Fn键设置
- ubuntu中关于通过编辑.bashrc文件修改提示符的简单过程
- Global/重写向/Render/目录详解
- VS2010报错:LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
- struts2中的constant配置详解
- 九度OJ 1497 面积最大的全1子矩阵 -- 动态规划
- Evaluate Reverse Polish Notation
- Unicast与Multicast
- Reactos当中的Rundll的实现
- linux 安装 mysql 备注
- Asp.Net页面生命周期