Created
May 1, 2012 10:13
-
-
Save IcodeNet/2567009 to your computer and use it in GitHub Desktop.
Umbraco Razor Script Retrieve CheckBox List Selected Values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var optionList = DynamicModel.TypeOfRoom; // TypeOfRoom is the check-box List | |
//Multiple Checkboxes selected | |
if (DynamicModel.TypeOfRoom.GetType() == typeof(Umbraco.Framework.Dynamics.BendyObject)){ | |
var options = DynamicModel.TypeOfRoom.__KeyedChildren; | |
foreach(var kv in options){ | |
RoomType is -- > @kv.Value | |
} | |
} | |
else // its a single checkbox selected | |
{ | |
@ DynamicModel.TypeOfRoom | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment