我现在想搞一下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");
}