This question is locked. New answers and comments are not allowed.
I am using the DropDownListFor helper, with a SelectList object containing a SelectListItem with Value = string.Empty and Text = "Please select one...". This is representing nothing being selected in the list. The value is eventually bound to a Nullable<int>. In the previous release, this was working fine; if this object was the selected value of the DropDownListFor the Nullable<int> would be properly set to null.
It looks like for SP1 this fix has broken my usage:
Fixed: ComboBox does not work with DropDownItems with Value property not set
Now the value being posted for my DropDownListFor is "Please select one..." instead of the expected/previously returned null. Model binding returns an invalid ModelState as it is an invalid value for Nullable<int>.
What is the recommendation for this functionality?
I attempted to change the SelectListItem to have both Value and Text equal to string.Empty, but when I do this the DropDownListFor has trouble rendering (the visible div is only 3-4 px in height).
It looks like for SP1 this fix has broken my usage:
Fixed: ComboBox does not work with DropDownItems with Value property not set
Now the value being posted for my DropDownListFor is "Please select one..." instead of the expected/previously returned null. Model binding returns an invalid ModelState as it is an invalid value for Nullable<int>.
What is the recommendation for this functionality?
I attempted to change the SelectListItem to have both Value and Text equal to string.Empty, but when I do this the DropDownListFor has trouble rendering (the visible div is only 3-4 px in height).