+ Reply to Thread
Results 1 to 2 of 2

Thread: Razor Routing

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    10

    Razor Routing

    I have a web site with something like this: http://site.com/Space/Action/Id
    Code:
    routes.MapRoute(
                "Default", // Route name
                "{space}/{action}/{id}", // URL with parameters
                new { space = "Space", action = "Action", id = UrlParameter.Optional } // Parameter defaults
            );
    Is there any way to route to the same action if the url changes to be http://site/Action/Id

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    30
    The Method should look like that :
    Code:
    routes.MapRoute(
        "Default", // Route name
        "{action}/{id}", // URL with parameters
        new { space = "Space", action = "Action", id = UrlParameter.Optional }
    );

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts