我有以下路线:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(null,"Conference/{shortName}/Submission/{submission}/{action}", new { controller = "Conference", action = "Show" });
routes.MapRoute(null,"Conference/{shortName}/{action}",new { controller = "Conference", action = "Index" });
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
以下(希望是显而易见的)链接都有效:
- /会议/testconf
- /会议/testconf/ShowSubmissions
- /会议/testconf/提交/firstSub
- /Conference/testconf/Submission/firstSub/EditSubmission
当我现在处于 Submission/firstSub 并像这样创建一个 ActionLink
@Html.ActionLink("Show Submissions", "ShowSubmissions", "Conference", new { shortName = Model.confereceShortName },null)
它创建以下链接
- /Conference/testconf/Submission/firstSub/ShowSubmissions
我怎样才能让 actionlink 忘记 Submission/firstSub 而不在那里硬编码?