Url Routing not working in ASP.Net MVC 3 Razor

Last Reply on Dec 17, 2013 07:56 AM By Mudassar

Posted on Dec 17, 2013 06:48 AM

 

when i use route link @html.routelink("Another page" ,"old")

is not redirecting to another page its redirecting to default page

please answer this question

routes.MapRoute("new",  "{controller}/{action}/{id}",  // URL with parameters
 new { controller = "Default1", action = "Index", id = UrlParameter.Optional } 
 // Parameter defaults);routes.MapRoute("old", // Route name
 "{controller}/{action}/{id}",  // URL with parameters
 new { controller = "Default2", action = "Index", id = UrlParameter.Optional } 
 // Parameter defaults);

 

Posted on Dec 17, 2013 07:56 AM

You cannot use Url in Routing, You need to simply pass Page Name