作为 MVC 的新手,我有一个问题。在 http 模块中,如何查找当前请求是否来自 mvc 页面,即 http://www.website.com/user/edit
我可以检查当前上下文中的某些内容吗?
最佳答案
您可以获得 Controller 和 Action 名称....
var request = httpContext.Request.RequestContext.RouteData.Values;
string ActionName = request["Action"].ToString();
string ControllerName = request["Controller"].ToString();
关于c# - 检查当前请求是否来自 httpmodule 中的 mvc 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10332480/