The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.

ProfileAreaRegistration.cs 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. namespace Teknik.Areas.Profile
  5. {
  6. public class ProfileAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Profile";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. context.MapSubdomainRoute(
  18. "Profile.Login", // Route name
  19. new List<string>() { "dev", "profile" }, // Subdomains
  20. "Login", // URL with parameters
  21. new { controller = "Profile", action = "Login" }, // Parameter defaults
  22. new[] { typeof(Controllers.ProfileController).Namespace }
  23. );
  24. context.MapSubdomainRoute(
  25. "Profile.Logout", // Route name
  26. new List<string>() { "dev", "profile" }, // Subdomains
  27. "Logout", // URL with parameters
  28. new { controller = "Profile", action = "Logout" }, // Parameter defaults
  29. new[] { typeof(Controllers.ProfileController).Namespace }
  30. );
  31. context.MapSubdomainRoute(
  32. "Profile.Register", // Route name
  33. new List<string>() { "dev", "profile" }, // Subdomains
  34. "Register", // URL with parameters
  35. new { controller = "Profile", action = "Register" }, // Parameter defaults
  36. new[] { typeof(Controllers.ProfileController).Namespace }
  37. );
  38. context.MapSubdomainRoute(
  39. "Profile.Settings", // Route name
  40. new List<string>() { "dev", "profile" }, // Subdomains
  41. "Settings", // URL with parameters
  42. new { controller = "Profile", action = "Settings" }, // Parameter defaults
  43. new[] { typeof(Controllers.ProfileController).Namespace }
  44. );
  45. context.MapSubdomainRoute(
  46. "Profile.Index", // Route name
  47. new List<string>() { "dev", "profile" }, // Subdomains
  48. "{username}", // URL with parameters
  49. new { controller = "Profile", action = "Index", username = UrlParameter.Optional }, // Parameter defaults
  50. new[] { typeof(Controllers.ProfileController).Namespace }
  51. );
  52. context.MapSubdomainRoute(
  53. "Profile.Action", // Route name
  54. new List<string>() { "dev", "profile" }, // Subdomains
  55. "Action/{action}", // URL with parameters
  56. new { controller = "Profile", action = "Index" }, // Parameter defaults
  57. new[] { typeof(Controllers.ProfileController).Namespace }
  58. );
  59. // Register Script Bundle
  60. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/profile").Include(
  61. "~/Scripts/bootbox/bootbox.min.js",
  62. "~/Scripts/jquery.blockUI.js",
  63. "~/Scripts/bootstrap-switch.js",
  64. "~/Areas/Profile/Scripts/Profile.js"));
  65. // Register Style Bundles
  66. BundleTable.Bundles.Add(new StyleBundle("~/Content/profile").Include(
  67. "~/Content/bootstrap-switch/bootstrap3/bootstrap-switch.css"));
  68. }
  69. }
  70. }