tags:

views:

30

answers:

1

Hello

I have a droplist, and I would like to add an All as the first one.

How is that done with asp.net mvc?

I have:

<%= Html.DropDownList("selCustomerID") %>

works great, but I don't have an empty "all-option". I populate it like this:

return View("Index", new CustomerAdminEditViewModel { selCustomerID = new SelectList(_cs.GetCustomers(), "CustomerID", "CustomerName") });
+1  A: 

Check this link : http://forums.asp.net/t/1429075.aspx

It is talking about an optional label parameter in the constructor.

Anuraj