After reading some information about changing my routes to get my detail view to work, I've discovered now my master view does not work and is wanting to display the detail view. Can someone help explain the correct way to do this?
I am looking to have a URL of Admin/MailingLists that shows all the lists. Then a URL of Admin/MailingLists/CLE.Announcements/ shows the details of one list. (note: the trailing slash was how I had to deal with a period in the list name)
Here is my current 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 }
);
}
}