Summary reference: Original address http://www.it165.net/pro/html/201305/5724.html
TryUpdateModel (model) By default matches the field in the form form on the View page with the Model field.
If the same, the values in the form are updated to the model,
If you want to update only a few fields, you can call its overloaded function
For example
New string " Field 1 " " Field 2 " " Field 3 " })
But if we have more than 10 20 fields on our page today, it might take a lot of time to use the above method to close the name of a field!
At this point we can use FormCollection to receive data from the View to do field updates, so you can change to the following wording:
TryUpdateModel (model, Fromvalue.allkeys) && modelstate.isvalid)
You can also exclude formcollection to receive certain fields from View data
"" New string "Field 1 " })
This allows you to exclude "field 1"
ASP. NET MVC TryUpdateModel Update model