如何在mvc4中创建路由URL

时间:2018-10-24 11:20:16

标签: asp.net-mvc-4 mvcroutehandler

我正在尝试跟踪网址,但未创建,请建议我........

网址:-/ landingpage / edg

RouteConfig.cs:-
   routes.MapRoute(
               name: "abc-def-Landing-Page",
               url: "landingpage/edg",
               defaults: new { controller = "Home", action = "index" }
 );

控制器:-

   [ActionName("abc-def-Landing-Page")]

    public ActionResult index()
    {
        return View("~/Views/Home/abc-def-Landing-Page.cshtml");
    }

0 个答案:

没有答案