Advertisement
jdcrowe

routes

Jun 20th, 2017 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1.     [RoutePrefix("MOTHERFUCKERY")]
  2.     public class GodDamnController : Controller
  3.     {
  4.         [Route("~/Trump", Name = "GOD")]
  5.         [Route("MOTHERFUCKERY/Trump", Name = "Impeach")]
  6.         public ActionResult Trump()
  7.         {
  8.             ViewBag.Title = "Our Dear Leader";
  9.             return View("Trump");
  10.         }
  11.     }
  12.  
  13. then...
  14. @Html.RouteLink("Click Me!", "GOD")
  15. or
  16. <a href="@Url.RouteUrl("Impeach")">touch me</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement