daveaglick / FluentBootstrap

Provides extensions, helper classes, model binding, and other goodies to help you use the Bootstrap CSS framework from .NET code.
http://www.fluentbootstrap.com
MIT License
200 stars 76 forks source link

Extensions to make sequences of form elements #34

Open daveaglick opened 9 years ago

daveaglick commented 9 years ago

For example, a Radio and/or RadioFor extension(s) that takes a sequence of KeyValuePair<string, object> and creates multiple radio buttons. What needs to be passed in? The description and value? What about label?

ryanelian commented 9 years ago

After some thoughts, maybe a cleaner approach would be to implement separate extensions (just to separate singular Radio and the multiple ones):

The second parameter can be either:

And like SelectFor, RadioListFor will also check / select the value that matches the property value when the page is rendered.