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

RadioField() public method

Generates a radio input type with the specified value to send to the served in case the element in checked. It will automatically check the radio if the target evaluated value is equal to the specified valueToSend.
public RadioField ( string target, object valueToSend, IDictionary attributes ) : string
target string The object to get the value from and to be based on to create the element name.
valueToSend object
attributes IDictionary Attributes for the FormHelper method and for the html element it generates
return string
		public string RadioField(string target, object valueToSend, IDictionary attributes)
		{
			target = RewriteTargetIfWithinObjectScope(target);

			object value = ObtainValue(target);

			bool isChecked = AreEqual(valueToSend, value);

			if (isChecked)
			{
				if (attributes == null)
				{
					attributes = new HybridDictionary(true);
				}

				AddChecked(attributes);
			}

			return CreateInputElement("radio", target, valueToSend, attributes);
		}

Same methods

FormHelper::RadioField ( string target, object valueToSend ) : string