Monday 23 October 2017

MVC - Database First - Stored Procedure - How to add First Empty Record to DropDownList




to add empty record replace
@Html.DropDownListFor(x=>x.or.ProductID, new SelectList(Model.pr, "ProductID", "Name"))

with
@Html.DropDownListFor(x=>x.or.ProductID, new SelectList(Model.pr, "ProductID", "Name"), "")

No comments:

Post a Comment