Click here to Skip to main content
15,749,352 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi all
i want use page mappageroutr in simple mvc project but i cant;

my code is:
C#
public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

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

            routes.MapRoute(
                "viewstudent", // Route name
                "view/viewstudent", // URL with parameters
                new { controller = "Movie", action = "Select", id = UrlParameter.Optional } // Parameter defaults
                )
                ;
       
        }

if i comment route "viewstudent" or comment route 'Default' my route is correct and work but two routmap with together dosent work!

thanks for any help
Posted
Comments
Zoltán Zörgő 19-Oct-12 8:52am    
Try switching the order of them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900