If my action has a path like /controller/action/{id}, I can get idin AuthorizeAttribute by doing httpContext.Request.RequestContext.RouteData.Values["id"].
Conversely, if it is something like /controller/action?id={id}, I can get it by doing httpContext.Request.QueryString["id"].
I will need another way if it forms the data from POST.
Is there a way to say: "Get what you specify in the parameter with the name" id ", regardless of how the route is specified?"
source
share