MVC: How to manage slahses in route parameters RRS feed

  • Question

  • I need to map two variables that could contain slashes, to a controller, in my ASP MVC application. Let's see this with an example.

    enter image description here

    • Repository and Path will be URL-encoded parameters.
    • Repository can have 0 slashes or 1 slash as a maximum (rep or rep/module)
    • Path can have an arbitrary number of slashes.

    For example these are valid URLs:


    Someone could give some suggestions about how to define this route?

    NOTE: I'm using ASP MVC 2.

    Thanks in advance

    • Moved by Caillen Sunday, July 27, 2014 12:08 PM
    Thursday, July 24, 2014 1:42 PM


  • ask here: forums.asp.net.

    This forum is for language questions not class library questions.

    Visual C++ MVP

    • Edited by Sheng Jiang 蒋晟 Thursday, July 24, 2014 2:20 PM
    • Proposed as answer by Caillen Sunday, July 27, 2014 12:09 PM
    • Marked as answer by Just Karl Saturday, August 2, 2014 1:09 PM
    Thursday, July 24, 2014 2:19 PM