i have one doubt
To use this sentence: filterContext.RouteData.Values["MyRouteValue"] the key should be declared in a Route in the route table right?
I mean, should be in the route table something like: {MyRouteValue}/
If i have a request like /Controller/Action?MyRouteValue=XXXXXXX im getting null from filterContext.RouteData.Values["MyRouteValue"]. This means that if i want to get the value i have to use filterContext.Controller.ValueProvider.GetValue(“publicationUrlTitle”).AttemptedValue istead?
Thanks in advance.
Regards.
Jose.
Yes.
Yes, use
ValueProvideror read it fromfilterContext.HttpContext.Request["MyRouteValue"]. The advantage of using ValueProvider is that it looks in many places: route data, GET query string parameters, POST parameters, custom value providers such as a JSON value provider in ASP.NET MVC 3, …Just be careful by when you access the
.AttemptedValueproperty as you might get aNREif theMyRouteValueis nowhere to be found.