Global configuration file


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.