Say I have a route like this:
"{controller}/{action}/{roomId}/{name}"
And a form action like this (And yes it looks like this in the action in the html ie post server processing):
Room/Index/6/SomeThing?pageNumber=1&amountToShow=5
And the form is simple:
<form action = "Room/Index/6/SomeThing?pageNumber=1&amountToShow=5" method="get">
<button type="submit">SomeButton</button>
</form>
Now when the button is clicked, the request somehow seems to half lose the pageNumber=1&amountToShow=5 part. In fact, when I looked in the ActionExecutingContext.ActionParameters list, the parameters are there (pageNumber and amountToShow) but there are no values. I even looked in the request, and there are no request parameters despite it knowing the url is "Room/Index/6/SomeThing?pageNumber=1&amountToShow=5".
I thought that maybe this had to do with the button and form, and maybe this wasn't possible but then I adjusted the route to:
"{controller}/{action}/{roomId}/{name}/{pageNumber}/{amountToShow}"
And it works, except the url is super formatted:
Room/Index/6/SomeThing/1/5
Which is to be expected since it's apparently doing it's job this time. Any ideas?
UPDATE
As suggest below by Adrian Godong, I tried using hidden inputs and it works but this still raises more questions. Why is it that with the more verbose route was able to handle the request parameters without hidden values but the shortened route isn't.