I have a situation on a single page web application. I use address information on the client to determine what data to load. I would like to be able to have url's like the following all direct to the Index action method on the HomeController.
http://mysite.com/Home/Index/Value/23/Another/34
http://mysite.com/Home/Index/Value/23/Another/34/StillAnother/45
In that controller method I would like a list of parameters such as:
{"Value", "23", "Another", "34"}
{"Value", "23", "Another", "34", "StillAnother", "45"}
Is this possible?
-
possible duplicate of Infinite URL Parameters for ASP.NET MVC RouteZeph– Zeph2013年08月18日 16:19:54 +00:00Commented Aug 18, 2013 at 16:19
1 Answer 1
A single page web application doesn't mean having a single Controller and Action so I hope that's not what you're after. If you're just trying to bind additional URL parameters, then it is easily accomplished using routing. Take a look at this question: Infinite URL Parameters for ASP.NET MVC Route