Why do I get null instead of empty string when receiving POST request in from Razor View?
I used to receive empty string when there was no value: [HttpPost] public ActionResult Add(string text) { // text is "" when there's no value provided by user } But now I'm passing a model [HttpPost] public ActionResult Add(SomeModel Model) { // model.Text is null when there's no value provided by user } So I have to use the ?? "" operator. Why is this happening? Michael Jubb You can use the DisplayFormat attribute on the property of your model class: [DisplayFormat(ConvertEmptyStringToNull = false)] The default model binding will create a new SomeModel for you. The default value for the