当前位置: 代码迷 >> ASP.NET >> 关于GLOBAL.ASAX的一个简单有关问题
  详细解决方案

关于GLOBAL.ASAX的一个简单有关问题

热度:4313   发布时间:2013-02-25 00:00:00.0
关于GLOBAL.ASAX的一个简单问题
我现在想搞一下URL重写,网上的参考代码都是直接在GLOBAL.ASAX中的Application_BeginRequest里面写代码,但是.NET2.0的GLOBAL.ASPX中好像并没有Application_BeginRequest,我自己加了一下也没实现网上的URL重写的效果,请高手指教。

------解决方案--------------------------------------------------------
up
------解决方案--------------------------------------------------------
直接写void Application_BeginRequest(....)就行
------解决方案--------------------------------------------------------
我也同意楼上的意见!
------解决方案--------------------------------------------------------
void Application_BeginRequest(Object sender, EventArgs e)
------解决方案--------------------------------------------------------
.NET2.0的GLOBAL.ASPX中好像并没有Application_BeginRequest
===>
有的

void Application_BeginRequest(object sender, EventArgs e)
{
//把所有的请求重定向到abc.aspx
System.Web.HttpContext.Current.RewritePath("abc.aspx");

}
  相关解决方案