只能在引发“HttpApplication.AcquireRequestState”之前调用“HttpContext.SetSessionStateBehavior”

广告:

string originalPath = Request.Path;

// MVC3+ running on IIS 7+
if (HttpRuntime.UsingIntegratedPipeline)
{
HttpContext.Current.Server.TransferRequest(Request.ApplicationPath, true);
HttpContext.Current.RewritePath(originalPath, false);
}
else
{
// Pre MVC 3
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current); //mvc3++之前

HttpContext.Current.RewritePath(originalPath, false);
}

广告:

编辑:Admin 时间:2024/8/4 10:55:56 阅览:36   返回    
AcquireRequestState
扫描关注53BK报刊官网
扫描关注阅速公司微信