【发布时间】:2014-04-02 13:47:05
【问题描述】:
我正在尝试使用 t4 模板,这样我就不必在操作链接中键入视图名称,但我不知道如何设置。
在我的布局页面中有一个链接:
<ul class="menu" >
<li>@Html.ActionLink("Profile", MVC.Profile.Views.Index)</li>
</ul>
所以我期待它加载:http://localhost:1234/Profile/Index,但它正在加载 http://localhost:1234/Login/~/Views/Profile/Index.cshtml
一些身体可以帮助解决这个问题吗?
默认路线:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Login", action = "Index", id = UrlParameter.Optional }
);
谢谢
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-routing url-routing t4