I am currently facing a similar problem with MVC3.
Despite [Bind(Exclude = "Password")] in my Action, ModelState.IsValid still returns false.
I noticed that TryUpdateModel(user, null, null, new string[]{"Password"}); successfully updated the model; but still returns a lie. Then I found out (somewhere in stackoverflow, apologies for the lack of a link) that TryUpdateModel really returns ModelState.IsValid .
So the problem is not with TryUpdateModel , but with ModelState.IsValid .
NB: this also means you don't need to check this twice ... you can use this code:
if (!TryUpdateModel(user, null, null, new string[]{"Password"})) return PartialView(user);
The problem is as if ModelState is still checking properties that were excluded from your FormCollection .
I managed to overcome this by removing the field from ModelState before calling TryUpdateModel :
ModelState.Remove("Password");
Note that TryUpdateModel still requires that the property list be excluded from the update in accordance with the code above.
Mark van proctor
source share