Posted By

wedgardigitalwkscom on 11/18/10


Tagged


Versions (?)

Global configuration file


 / Published in: C#
 

URL: http://www.digitalwks.com/blogs/wilson-edgar/?p=28

  1. public class MvcApplication : System.Web.HttpApplication
  2. {
  3. public static void RegisterRoutes(RouteCollection routes)
  4. {
  5. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  6.  
  7. routes.MapRoute(
  8. "Default", // Route name
  9. "{controller}/{action}/{id}", // URL with parameters
  10. new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
  11. );
  12.  
  13. }
  14.  
  15. protected void Application_Start()
  16. {
  17. AreaRegistration.RegisterAllAreas();
  18.  
  19. RegisterRoutes(RouteTable.Routes);
  20. }
  21. }

Report this snippet  

You need to login to post a comment.