多个控制器和具有相同名称的视图

时间:2013-11-26 00:58:07

标签: c# asp.net-mvc asp.net-mvc-4 asp.net-mvc-routing

我需要帮助来创建具有相同名称的多个视图和控制器。

为了解决控制器的问题,我做到了:

    routes.MapRoute(
        name: "Leads",
        url: "Leads/{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
        namespaces: new string[] { "Project.Controllers.Leads" });

    // Default route.
    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
        namespaces: new string[] { "Project.Controllers" });

但我需要帮助来创建具有相同名称的多个视图。

感谢。

0 个答案:

没有答案