我有
public MvcHtmlString(this UrlHelper url)
{
string controller = //???
string action = //????
}
有谁知道解决方案?
答案 0 :(得分:5)
试试这个:
string controller = url.RequestContext.RouteData.Values["controller"];
string action = url.RequestContext.RouteData.Values["action"];