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.

AdminAreaRegistration.cs 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. using Teknik.Configuration;
  5. using Teknik.Helpers;
  6. namespace Teknik.Areas.Admin
  7. {
  8. public class AdminAreaRegistration : AreaRegistration
  9. {
  10. public override string AreaName
  11. {
  12. get
  13. {
  14. return "Admin";
  15. }
  16. }
  17. public override void RegisterArea(AreaRegistrationContext context)
  18. {
  19. Config config = Config.Load();
  20. context.MapSubdomainRoute(
  21. "Admin.Dashboard", // Route name
  22. new List<string>() { "admin" }, // Subdomains
  23. new List<string>() { config.Host },
  24. "", // URL with parameters
  25. new { controller = "Admin", action = "Dashboard", username = string.Empty }, // Parameter defaults
  26. new[] { typeof(Controllers.AdminController).Namespace }
  27. );
  28. context.MapSubdomainRoute(
  29. "Admin.Search", // Route name
  30. new List<string>() { "admin" }, // Subdomains
  31. new List<string>() { config.Host },
  32. "Search", // URL with parameters
  33. new { controller = "Admin", action = "Search", username = string.Empty }, // Parameter defaults
  34. new[] { typeof(Controllers.AdminController).Namespace }
  35. );
  36. context.MapSubdomainRoute(
  37. "Admin.Action", // Route name
  38. new List<string>() { "blog" }, // Subdomains
  39. new List<string>() { config.Host },
  40. "Action/{controller}/{action}", // URL with parameters
  41. new { controller = "Admin", action = "Dashboard" }, // Parameter defaults
  42. new[] { typeof(Controllers.AdminController).Namespace }
  43. );
  44. // Register Script Bundles
  45. BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/Search", config.CdnHost).Include(
  46. "~/Areas/Admin/Scripts/Search.js"));
  47. }
  48. }
  49. }