예제 #1
0
 protected void uniqValue_Required_ServerValidate(object source, ServerValidateEventArgs args)
 {
     args.IsValid = true;
     if (ViewState[FieldName + "FieldClassName"] != null)
     {
         string realName = FieldName;
         if (FieldName.Contains("."))
         {
             realName = FieldName.Substring(FieldName.IndexOf(".") + 1);
         }
         MetaField field = MetaDataWrapper.GetMetaFieldByName(ViewState[FieldName + "FieldClassName"].ToString(), realName);
         if (!MetaObjectProperty.CheckUniqueValue(field, ObjectId, this.Value))
         {
             args.IsValid = false;
         }
     }
 }