Reputation: 5394
With a POST request in case it has the same parameter in the query string and in the body of the request which one takes priority with model binding?
Upvotes: 5
Views: 850
Reputation: 29186
From this article, in the "Value Provders" section.
So if the same name appears in multiple places, the last place the model binder looks will take precedence (I think), in your case, the querystring.
Easiest thing to do is try it. Enter a url with a &id=23" and make sure you have a HTML input field named "id" and POST that back to the controller and see which one is passed.
Upvotes: 7