开发者

User HTML Helper to populate a DropDown list

开发者 https://www.devze.com 2022-12-11 01:31 出处:网络
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:

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

精彩评论

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