开发者

User HTML Helper to populate a DropDown list

I'm trying to p开发者_Go百科opulate 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.


Try using

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜