RouteConfig.cs 1.0 KB

12345678910111213141516171819202122232425262728
  1. using System.Web.Http;
  2. using System.Web.Mvc;
  3. using System.Web.Routing;
  4. namespace WeOnlineApp
  5. {
  6. public class RouteConfig
  7. {
  8. public static void RegisterRoutes(RouteCollection routes)
  9. {
  10. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  11. routes.MapRoute("M", url: "M", defaults: new { controller = "MsgMonitor", action = "Index", id = UrlParameter.Optional });
  12. routes.MapRoute("Play", url: "P", defaults: new { controller = "Play", action = "Index", id = UrlParameter.Optional });
  13. //ASP.NET Web API Route Config
  14. routes.MapHttpRoute(
  15. name: "DefaultApi",
  16. routeTemplate: "api/{controller}/{id}",
  17. defaults: new { id = RouteParameter.Optional }
  18. );
  19. routes.MapRoute(
  20. name: "Default",
  21. url: "{controller}/{action}/{id}",
  22. defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  23. );
  24. }
  25. }
  26. }