Model View Controller (MVC) Question:

How do you handle variable number of segments in a route definition?

Tweet Share WhatsApp

Answer:

Use a route with a catch-all parameter. An example is shown below. * is referred to as catch-all parameter.
controller/{action}/{*parametervalues}

Download MVC PDF Read All 48 MVC Questions
Previous QuestionNext 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?