I am using some 3rd party classes. I want to get the routevalues of my controller in that. Unfortunately it doesn’t hand me the current controller that is executing. Can I get it from HttpContext?
The class looks something like:
public class ServiceStationVisibilityProvider
: ISiteMapNodeVisibilityProvider
{
public bool IsVisible(SiteMapNode node, HttpContext context, IDictionary<string, object> sourceMetadata)
{
node.Title = DateTime.Now.ToString(); //need to access routevalues and set title
return true;
}
Now I could manully inspect Request.RawUrl and parse and do funky things. However, I don’t want to write that kind and fall into trouble later when the application grows.
}
You can search the values of
"controller"and"action"in this object