开发者

ASP.NET MVC a binded list of RadioButtons where only one RadioButton can be checked

开发者 https://www.devze.com 2023-01-30 00:24 出处:网络
I have a list of EmailAddress object and each e-mail adress has an int ID, a string Email, and a bool Prefered.

I have a list of EmailAddress object and each e-mail adress has an int ID, a string Email, and a bool Prefered.

I want to render the email adress in a textbox followed by a radio button for the option of prefered. The user should be shown all email addresses and only one prefered radi开发者_开发问答o button should be checked.

The trouble I have is because I am using a list of bools and binding to a list, the name attribute on each html Input tag will be different in order that the list of texboxes and radio buttons can be bound to the IList

Is this acheiveable? If so, how? I can't seem to find anything out there.

0

精彩评论

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