Using the Html.BeginForm and Html.BeginRouteForm I had a situation tonight where on my production server all the form tags where generated as <form action=”” method=”post” even thought controller and action were properly defined! Found this post ..
http://stackoverflow.com/questions/1003040/asp-net-mvc-html-beginform-problem
which directed me to the fact that I had recently added a param to the default route
routes.MapRoute(“Default”, “{controller}/{action}/{id}/{section}”, new { controller = “Home”, action = “Index”, id = “”, section=”” } );
I still don’t understand why, but this causes the html helper to generate an empty action url as it cannot map the generated url to any route!!?? The temp fix I currently implemented (and is hopefully saving my a## untill tomorrow) is to add the Default “Default” url after the modified default url 🙂
routes.MapRoute(“DefaultOrginal”,”{controller}/{action}/{id}”,new { controller = “Home”, action = “Index”, id = “” }
Did you come up with a final fix to this, or did the temp fix become the perminant fix?