Exemplo n.º 1
0
 /// <summary>
 /// 获取控件文本内容
 /// </summary>
 /// <param name="textCtrl"></param>
 /// <returns></returns>
 public static string GetText(ITextControl textCtrl)
 {
     if (textCtrl == null)
     {
         throw new ArgumentNullException("获取文本内容的控件不能为空!");
     }
     if (string.IsNullOrEmpty(textCtrl.Text))
     {
         return("");
     }
     return(Utility.HtmlEncode(TextFilter.FilterScript(textCtrl.Text.Trim())));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取控件文本内容
 /// </summary>
 /// <param name="valueCtrl"></param>
 /// <returns></returns>
 public static string GetText(HtmlInputControl valueCtrl)
 {
     if (valueCtrl == null)
     {
         throw new ArgumentNullException("获取文本内容的控件不能为空!");
     }
     if (string.IsNullOrEmpty(valueCtrl.Value))
     {
         return("");
     }
     return(Utility.HtmlEncode(TextFilter.FilterScript(valueCtrl.Value.Trim())));
 }