C# Programming
10-31-2011, 03:23 PM
I am using MVC3 with razor and binding dropdownlist with a list
Now issue is
@Html.DropDownListFor(model => model.Result, new SelectList(Model.Result.OrderBy(item => item.Enhet), "EnhetID", "Enhet"), "ALL")
in Enhet i am getting 3 values
Nitin
NA
NA
I want to make sure that values are always unique, how can i remove duplicate values.
Now issue is
@Html.DropDownListFor(model => model.Result, new SelectList(Model.Result.OrderBy(item => item.Enhet), "EnhetID", "Enhet"), "ALL")
in Enhet i am getting 3 values
Nitin
NA
NA
I want to make sure that values are always unique, how can i remove duplicate values.