'Details' in asp.net mvc routing doesn't seem to get removed....

Posted by Pandiya Chendur on Stack Overflow See other posts from Stack Overflow or by Pandiya Chendur
Published on 2010-05-06T05:08:13Z Indexed on 2010/05/06 5:18 UTC
Read the original article Hit count: 209

I am trying to remove Details from http://localhost:1985/Materials/Details/2/Steel but some how my route doesn't seem to work...

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default",                                             
                "{controller}/{action}/{id}",                          
                new { controller = "Materials", action = "Index", id = "" } 
            );

            routes.MapRoute(
             "Details View",
             "{controller}/{id}/{name}",
              new { controller = "Materials", action = "Details", id = "",
                                               name = "" }
                );

        }

What am i doing wrong? Any suggestion....

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about url-routing