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.

BlogAreaRegistration.cs 3.1KB

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