I have a creation view with several DropDownListFors. Every time a new object is created, only 1 of the DropDownListFors should have a value, I want the rest to return 0 as the result when choosing the Label option.
How to set 0 as the value for DropDownList for the Label option?
EDIT: Here is an example of my DropDownListFor code in my opinion:
@Html.DropDownListFor(model => model.cardReward.ID, new SelectList(ViewBag.cardReward, "Id","Name"), "None")
When I create the page, it creates a list with None at the top, like this:
<option value>None</option>
I want it to be like this:
<option value="0">None</option>
source share