Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check if current request is from mvc page in httpmodule

Being new to MVC I have a question. In a http module, how can I find if the current request was from a mvc page ie http://www.website.com/user/edit

Is there something in the current context I can check for?

like image 999
amateur Avatar asked Sep 06 '25 08:09

amateur


1 Answers

You can get the controller and action name....

var request = httpContext.Request.RequestContext.RouteData.Values;
string ActionName = request["Action"].ToString();
string ControllerName = request["Controller"].ToString();
like image 123
naim shaikh Avatar answered Sep 10 '25 09:09

naim shaikh