【发布时间】:2015-12-02 18:51:41
【问题描述】:
我在 asp.net 中进行开发。最近发现asp.net 5里面没有Global.asax文件。
要放入Global.asax 文件的其中一件事是 URL 重写。
Global.asax 文件消失了。我可以在哪里放置 URL 重写代码。我的意思是我在ASP.NET 4.0中做这样的事情@
HttpContext.Current.RewritePath(...);
我不想使用 URL 重写模块。我只想用HttpContext.Current.RewritePath 方法来做。
我的问题是我可以把上面的代码放在ASP.NET 5的什么地方?
【问题讨论】:
-
OWIN 中间件是 ASP.NET vNext 中 HttpModules 的替代品。
-
是的,正如我所说,它是 Startup.cs!
-
global.asax中有Application_BeginRequest之类的事件吗?
标签: c# asp.net .net url-rewriting asp.net-core