廣告:
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);
 }
廣告:
