【发布时间】:2010-04-06 18:09:21
【问题描述】:
为什么没有在 Url 中添加使用 UrlHelper 定义的扩展方法。EXTENSIONMETHOD 当我想在控制器中使用它时!但我可以访问它?
public static string Home(this UrlHelper helper)
{
return helper.RouteUrl("ABC", new { controller = "ABC", Action = "Default" });
}
我还没有访问:
public ActionResult Default()
{
return Redirect(Url.Home());
}
我有访问权限:
<a href="<%=Url.Home() %>" title="Hello">Hello</a>
【问题讨论】:
标签: asp.net-mvc controller extension-methods urlhelper