ASP.NET MVC routing conflict - null value for input variable
I'm at a loss as to why my routes are conflicting. I have these in my Global.asax file: routes.MapRoute( "CustomerView", "{controller}/{action}/{username}", new { controller = "Home", action = "Index", username = "" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "0" } ); So far everything has worked fine except when I created a controller action like so: public ActionResult MyAction(int id) { //Do stuff here return View(); } When I try viewing it through http://mydomain/MyController/MyAction/5 I get: Server Error in '/'