You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7 KiB

4 years ago
  1. ==========================================================
  2. ASP.NET Friendly URLs v1.0.1
  3. ==========================================================
  4. ----------------------------------------------------------
  5. Overview
  6. ----------------------------------------------------------
  7. ASP.NET Friendly URLs provides a simple way to remove the
  8. need for file extensions on URLs for registered file
  9. handler types, e.g. .aspx.
  10. For more information see http://go.microsoft.com/fwlink/?LinkID=264514&clcid=0x409
  11. ----------------------------------------------------------
  12. Setup
  13. ----------------------------------------------------------
  14. If your app didn't have a RouteConfig class before
  15. installing ASP.NET Friendly URLs package:
  16. ----------------------------------------------------------
  17. The package includes a RouteConfig class that contains
  18. the call required to enable Friendly URLs. This call must
  19. be made from the Application_Start handler in your app's
  20. Global.asax file.
  21. Add the following to your Global.asax.cs file:
  22. using System.Web.Routing;
  23. ...
  24. protected void Application_Start(object sender, EventArgs e)
  25. {
  26. RouteConfig.RegisterRoutes(RouteTable.Routes);
  27. }
  28. If your app had a RouteConfig class before installing
  29. ASP.NET Friendly URLs package:
  30. ----------------------------------------------------------
  31. You'll need to update your RouteConfig class to enable
  32. Friendly URLs.
  33. Call EnableFriendlyUrls() in your RegisterRoutes method
  34. *before* any existing route registrations:
  35. public static void RegisterRoutes(RouteCollection routes)
  36. {
  37. routes.EnableFriendlyUrls();
  38. // Put any additional route registrations here.
  39. }