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.

ContactAreaRegistration.cs 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. using Teknik.Configuration;
  5. namespace Teknik.Areas.Contact
  6. {
  7. public class ContactAreaRegistration : AreaRegistration
  8. {
  9. public override string AreaName
  10. {
  11. get
  12. {
  13. return "Contact";
  14. }
  15. }
  16. public override void RegisterArea(AreaRegistrationContext context)
  17. {
  18. Config config = Config.Load();
  19. context.MapSubdomainRoute(
  20. "Contact.Index", // Route name
  21. new List<string>() { "contact" }, // Subdomains
  22. new List<string>() { config.Host }, // domains
  23. "", // URL with parameters
  24. new { controller = "Contact", action = "Index" }, // Parameter defaults
  25. new[] { typeof(Controllers.ContactController).Namespace }
  26. );
  27. context.MapSubdomainRoute(
  28. "Contact.Action", // Route name
  29. new List<string>() { "contact" }, // Subdomains
  30. new List<string>() { config.Host }, // domains
  31. "{action}", // URL with parameters
  32. new { controller = "Contact", action = "Index" }, // Parameter defaults
  33. new[] { typeof(Controllers.ContactController).Namespace }
  34. );
  35. // Register Bundles
  36. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/contact").Include(
  37. "~/Areas/Contact/Scripts/Contact.js"));
  38. }
  39. }
  40. }