MVC binding form data problem.
- by John
I am using an object that matches all the fields in my form. I then use the default binding to populate the object in my action, like this;
public ActionResult GetDivisionData(DivisionObj FormData)
My DivisionObj initializes all it's values to string.empty in the constructor.
The problem is that when the binder populates the model from the posted form data, any data that is not posted is set to null in the object, eventhough I initialized the object to contain empty strings.
Is there a way to change this so that unposted data will be an empty string.