Model View Controller (MVC) Question:
How do you handle variable number of segments in a route definition?
Answer:
Use a route with a catch-all parameter. An example is shown below. * is referred to as catch-all parameter.
controller/{action}/{*parametervalues}
controller/{action}/{*parametervalues}
Previous Question | Next Question |
What is the difference between adding routes, to a webforms application and to an mvc application? | What are the 2 ways of adding constraints to a route? |