justSteve
justSteve

Reputation: 5524

User HTML Helper to populate a DropDown list

I'm trying to populate a dropdown list with a list returned by a query to my object's facade. I've seen a couple examples here but nothing close enough to my use case. Seems like:

<%= Html.DropDownList("User.Affiliate", UserFacade.Instance.SelectAffiliates())%>

should work but doesn't.

Upvotes: 0

Views: 448

Answers (1)

Alexander Prokofyev
Alexander Prokofyev

Reputation: 34515

Try using

<%= Html.DropDownList("User.Affiliate", 
    new SelectList(UserFacade.Instance.SelectAffiliates()))%>

Upvotes: 1

Related Questions