Thursday, December 13, 2012

Ever had a View in MVC that was being reused by the Controller but the View doesn't display all the fields from the Model class?

What doesn't work is creating another view to display the data. So don't waste your time trying to create another View!

What does work is this:

ModelState.Remove( "yourModel'sDataName" );

You put the above statement (with your Model's Data Name) in the controller for every field that is not displaying even though you know that the Model class has data.

No comments:

Post a Comment