In the past I have done development MediaWiki and am interesting in creating a route similar to the Wiki format {namespace}:{article}
.
In the process of testing out my creation but am running into problems with the URL pattern.
routes.MapRoute(
name: "Generic" ,
url: "{controller}:{name}" ,
defaults: new {
controller = "Article" ,
action = "View" ,
name = "Home"
} ,
constraints = new {
name = @"^[\w]+$"
}
);
Currently the problem is the colon :
. In order for the url to work the way I need, I have to have the colon in the url for it to parse it out.
This MapRoute is also the only Route I have so far.
Was wondering how I should create the MapRoute for MVC so that the colon notation is optional, and defaults to the Article Controller.