Guest User

Untitled

a guest
Apr 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. routes.MapRoute(
  2. name: "slug",
  3. url: "{slug}",
  4. defaults: new { controller = "Home", action = "show" },
  5. constraints: new { slug = ".+" });
  6.  
  7. public async Task<ActionResult> Show(string slug)
  8. {
  9. return RedirectToRoute(ProfileControllerRoute.GetIndex, new { slug = slug});
  10. }
  11.  
  12. [Route("GetIndex", Name = ProfileControllerRoute.GetIndex)]
  13. public ActionResult Index(int? page, string slug = null)
Add Comment
Please, Sign In to add comment