Take the 2-minute tour ×

Say I have a route like this:


And a form action like this (And yes it looks like this in the action in the html ie post server processing):


And the form is simple:

<form action = "Room/Index/6/SomeThing?pageNumber=1&amountToShow=5" method="get">
   <button type="submit">SomeButton</button>

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:


And it works, except the url is super formatted:


Which is to be expected since it's apparently doing it's job this time. Any ideas?


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.

share|improve this question

2 Answers 2

Have you tried moving the query string parameters into hidden input fields?

So, instead of your form block, try this:

<form action = "Room/Index/6/SomeThing" method="get">
    <input type="hidden" name="pageNumber" value="1" />
    <input type="hidden" name="amountToShow" value = "5" />
share|improve this answer
I can give that a try but still wondering why the action fails like this. –  Programmin Tool Jul 27 '09 at 19:09
This works but only adds to the confusion. There has to be something odd going on with forms, get, and routes. –  Programmin Tool Jul 27 '09 at 19:27
apparently this is just how html forms work... see stackoverflow.com/questions/1116019/… which talks about the same issue outside of asp.net –  Robert Levy Apr 6 '12 at 14:37

I think it gets munged cause when you submit a form via get it appends ‘?formvalue=value&otherfield=annothervalue...’ to the request string. This may cause your ‘?stuff=value’ to get ignored by IIS/ASP.

share|improve this answer

Your Answer


