Castle.MonoRail.Framework.Helpers.FormHelper.CreateCheckboxList C# (CSharp) Method

CreateCheckboxList() public method

Creates a CheckboxList instance which is enumerable. For each interaction you can invoke CheckboxList.Item() which will correctly render a checkbox input element for the current element on the supplied set (dataSource).

The enumerable item will be an element of the dataSource.

If the dataSource elements are complex objects (ie not string or primitives), supply the parameters value and text to the dictionary to make the helper use the specified properties to extract the option value and content respectively.

Usually both the target and obviously the dataSource are sets with multiple items. The element types tend to be the same. If they are not, you might have to specify the suffix parameters on the attributes as it would not be inferred.

public CreateCheckboxList ( string target, IEnumerable dataSource ) : CheckboxList
target string The object to get the value from and to be based on to create the element name.
dataSource IEnumerable The set of available elements
return CheckboxList
		public CheckboxList CreateCheckboxList(string target, IEnumerable dataSource)
		{
			return CreateCheckboxList(target, dataSource, null);
		}

Same methods

FormHelper::CreateCheckboxList ( string target, IEnumerable dataSource, IDictionary attributes ) : CheckboxList