/// <summary> /// 尝试获取字段名 /// </summary> /// <param name="input">输入控件</param> /// <returns></returns> protected virtual string GetFieldName(IHtmlInputControl input) { if (input == null) { throw new ArgumentNullException("input"); } var labels = input.Labels(); if (labels.Length == 1) { return(labels[0].Text); } else { return(input.Name); } }
/// <summary> /// 尝试获取字段名 /// </summary> /// <param name="input">输入控件</param> /// <returns></returns> protected virtual string GetFieldName( IHtmlInputControl input ) { if ( input == null ) throw new ArgumentNullException( "input" ); var labels = input.Labels(); if ( labels.Length == 1 ) return labels[0].Text; else return input.Name; }