Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // should allow routing to /Article/article-title type URL using the Index view in the specified Controller
- // Example URL: /Article/tweaking-asp.net-identity-to-add-first-and-last-name-as-username
- public class RouteConfig
- {
- public static void RegisterRoutes(RouteCollection routes)
- {
- routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
- // Intent is to set up a route for ~/Article/{slug}
- // where {slug} represents the url-friendly version of the article title
- routes.MapRoute(
- name: "Articles",
- url: "Article/{*slug}",
- defaults: new { controller = "Article", action = "Index", slug = UrlParameter.Optional }
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement