I have two routes mapped in my MVC application:
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Project",
"{controller}/{projectid}/{action}/{id}",
new { controller = "Project", action = "Index", id = "" });
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
}
For the most part, these pose no problems, but I do strike trouble when trying to call the /Account/LogOn view. My ActionLink syntax looks like this (I've tried a couple of variations including null route values and such):
<%= Html.ActionLink("Log On", "LogOn", "Account") %>
Browsing to this view raises a 404 error ("The resource cannot be found"). Ideally I'd like to avoid a huge amount of rework, so what would be the best way to avoid these clashes?