views:

53

answers:

2

I've asked here about how to remove RouteData and QueryString sources from ValueProvider. And this question came out:

When does the UpdateModel needs values from RouteData and QueryString? Why this is left as default feature? I see point to use RouteData and QueryString to call the correct controllers methods and provide parameters for them but not to update model. Or am I missing something?

Do you know some explanation for this?

Thank you.

A: 

I imagine it's for the same reason as making extra RouteValues show up in the querystring when you parse a route - to give the easiest possible default behaviour.

There are lots of cases where people prefer to use querystrings for their applications, so having this default behaviour would take some of the work out of trying to reconstruct models.

womp
If you broaden your perspective though, not everyone will use POST to pass data. What if you had a Map object that you wanted to update from a Google Maps URL? There are valid reasons for doing non-POST data passing, and it makes it easier if you can do UpdateModel() in all cases rather than just for POSTing.
womp
A: 

Any GET request. You would normally use the Querystring to, for example, present a page number or any filtering options. In some cases those might be relevant to your model.

jeef3