RadioSet Syntax

23 views
Skip to first unread message

Adinahc

unread,
Aug 30, 2011, 12:30:00 PM8/30/11
to mvccontrib-discuss
I have been poking around and cannot seem to find information on how
to use RadioSet. Could anyone tell me how I might use this in my
razor application?
Thank you

Tim Scott

unread,
Aug 30, 2011, 1:53:25 PM8/30/11
to mvccontri...@googlegroups.com
Simple case:

@this.RadioSet(x => x.SomeProperty).Options(Model.SomeOptions)

Model.SomeOptions will be the values and labels. It would be a SelectList or an IDictionary<,>. There are several other overloads for Options -- which are reasonably well documented via Intellisense.

Model.SomeProperty is what the selected value will bind to. It's type would be the same as the Value of the SelectList or the key of the IDictionary. Hope this helps.

Tim

> --
> Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project. Or go to http://mvccontrib.org
>
> To unsubscribe from this group, send email to mvccontrib-disc...@googlegroups.com (mailto:mvccontrib-disc...@googlegroups.com)
> For more options, visit this group at http://groups.google.com/group/mvccontrib-discuss?hl=en


Adinahc

unread,
Aug 31, 2011, 9:11:21 AM8/31/11
to mvccontrib-discuss
Awesome!
Thank you so much!

On Aug 30, 11:53 am, Tim Scott <tsc...@lunaversesoftware.com> wrote:
> Simple case:
>
> @this.RadioSet(x => x.SomeProperty).Options(Model.SomeOptions)
>
> Model.SomeOptions will be the values and labels. It would be a SelectList or an IDictionary<,>. There are several other overloads for Options -- which are reasonably well documented via Intellisense.
>
> Model.SomeProperty is what the selected value will bind to. It's type would be the same as the Value of the SelectList or the key of the IDictionary. Hope this helps.
>
> Tim
>
>
>
>
>
>
>
> On Tuesday, August 30, 2011 at 11:30 AM, Adinahc wrote:
> > I have been poking around and cannot seem to find information on how
> > to use RadioSet. Could anyone tell me how I might use this in my
> > razor application?
> > Thank you
>
> > --
> > Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project. Or go tohttp://mvccontrib.org
Reply all
Reply to author
Forward
0 new messages