FluentBootstrap
FluentBootstrap copied to clipboard
Extensions to make sequences of form elements
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?
After some thoughts, maybe a cleaner approach would be to implement separate extensions (just to separate singular Radio and the multiple ones):
RadioListfirst parameter takesnameas astringRadioListForfirst parameter takes the usual lambda expression to the view model.
The second parameter can be either:
- A sequence of
stringand generates multiple radio inputs using eachstringas the HTMLlabelandvalueproperty. - A sequence of
KeyValuePair<string,string>and uses eachKeyproperty as the HTMLlabelproperty and theValueproperty as thevaluefor the inputs.
And like SelectFor, RadioListFor will also check / select the value that matches the property value when the page is rendered.