摘要:
(一) 利用验证服务器控件进入Formview的模版编辑状态,选择InsertItemTemplate模版或EditItemTemplate模版,将验证服务器控件(如RequiredFieldValidator)拖放到打开的相应模版,然后在CtrolToValidate属性中指定需要验证的 相应字段,在ErrorMessage属性中输入出错提示信息即可。(二) 利用FormView的ItemInserting和ItemUpdating事件例如:protected void FormView1_ItemInserting(object sender, FormViewInsertEventArg 阅读全文