asp.net mvc routing id parameter
- by parminder
Hi Experts,
I am working on a website in asp.net mvc. I have a route
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
which is the default route. Now I have method
public ActionResult ErrorPage(int errorno)
{
return View();
}
now if i want to run this code with http://something/mycontroller/Errorpage/1
it doesnt work. but if i change the parameter name to id from errorno
it works.
Is it cumpulsory to have same parameter name for this method. Or I need to create seperate routes for such situations.
Regards
Parminder