Using MVC, I have an html form helper in my view:
using (Html.BeginForm("ActionOne", "ControllerOne")) ...
Using the default route, the output for the action attribute is as expected:
<form action="/ControllerOne/ActionOne" ...
But registrering a new route with seemingly no matches affects the output.
Routing code:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.Add("testRoute", new Route("MyUrl", new MvcRouteHandler()));
routes.MapRoute("Default", "{controller}/{action}", new { controller = "Home", action = "Index"});
}
Output:
<form action="/MyUrl?action=ActionOne&controller=ControllerOne"
Is this by design or am I mising something fundamental?
Cheers!