How to strip url parameters in url route?

How to set up a url for a scenario like:

www.website.com/ [project name] / News / Submit / [Possible additional parameters]

[project name] = variable that will be required for the action to indicate which project News = Controller Submit = Action [possible optional parameters] = id

I haven't come across examples of how to do this yet. Any thoughts would be greatly appreciated.

+1


a source to share


1 answer


routes.MapRoute("myroute", "{projectname}/{controller}/{action}/{id}", new { id = "" });

      

Then your action methods will have a project name and an id parameter.



If your question is how to route multiple real web applications, then you are in a different world :)

+2


a source







All Articles