System.Web.UI.WebControls.BaseValidator.GetControlValidationValue C# (CSharp) Method

GetControlValidationValue() protected method

protected GetControlValidationValue ( string name ) : string
name string
return string
		protected string GetControlValidationValue (string name)
		{
			Control control = NamingContainer.FindControl (name);

			if (control == null)
				return null;

			PropertyDescriptor prop = BaseValidator.GetValidationProperty (control);
			if (prop == null)
				return null;

			object o = prop.GetValue (control);

			if (o == null)
				return String.Empty;
			
			if (o is ListItem)
				return ((ListItem) o).Value;
			
			return o.ToString ();
		}