在阅读有关更改路线以使我的详细信息视图生效的一些信息之后,我发现现在我的主视图不起作用并且想要显示详细视图。有人可以帮助解释这样做的正确方法吗?
我希望有一个显示所有列表的Admin / MailingLists网址。然后,Admin / MailingLists / CLE.Announcements /的URL显示一个列表的详细信息。 (注意:尾部斜线是我必须处理列表名称中的句点的方式)
这是我目前的RouteConfig:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// Admin/MailingLists
routes.MapRoute(
name: "MailingLists",
url: "Admin/MailingLists",
defaults: new { controller = "Admin", action = "MailingLists" }
);
// Admin/MailingLists/CLE.Announcements/
routes.MapRoute(
name: "MailingList",
url: "Admin/MailingLists/{listName}/",
defaults: new { controller = "Admin", action = "SubscriberList", listName = UrlParameter.Optional }
);
// Admin/getMailingListSubscribers/CLE.Announcements
routes.MapRoute(
name: "getMailingListSubscribers",
url: "Admin/getMailingListSubscribers/{listName}",
defaults: new { controller = "Admin", action = "getMailingListSubscribers", listName = UrlParameter.Optional }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}