How do I create a dropdown in ASP.NET MVC that can handle a null value?
The application is a lookup field in a database, where the primary key is in a lookup table, i.e. Categories, and the foreign key is in another table, i.e. CategoryID, but CategoryID is OPTIONAL (i.e. it can contain a null).
I would imagine the generated markup in the user's web page would look something like this:
<select id="foo">
<option value="">(Not Specified)</option>
<option value="1">Alpha</option>
<option value="2">Bravo</option>
<option value="3">Charlie</option>
</select>
Can I do something like this without having to write a custom HtmlHelper? Would this bind properly to the underlying model when the time comes to save?