Exemplo n.º 1
0
        /// <summary>
        /// 验证服务器端控件集合
        /// </summary>
        /// <param name="controls"></param>
        /// <param name="controls_key">选择指定的字段进行验证</param>
        /// <returns></returns>
        public Validator Validate(Control[] controls, params string[] controls_key)
        {
            IDictionary <string, object> dict = new Dictionary <string, object>();

            IDictionary <string, object> allDict = WebControlUtility.GetAllValue(controls);

            foreach (string req_key in controls_key)
            {
                if (allDict.ContainsKey(req_key))
                {
                    dict.Add(req_key, allDict[req_key]);
                }
            }

            return(Validate(dict));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 验证服务器端控件集合
 /// </summary>
 /// <param name="controls">控件集</param>
 /// <returns></returns>
 public Validator Validate(ControlCollection controls)
 {
     return(Validate(WebControlUtility.GetAllValue(controls)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 验证服务器端控件集合
 /// </summary>
 /// <param name="controls">控件集</param>
 /// <returns></returns>
 public Validator Validate(params Control[] controls)
 {
     return(Validate(WebControlUtility.GetAllValue(controls)));
 }