
RequiredFieldValidator簡介
網址:http://msdn.microsoft.com/zh-tw/library/system.web.ui.webcontrols.requiredfieldvalidator%28VS.80%29.aspx
基本設定
1、在Textbox旁放RequiredFieldValidator物件
2、RequiredFieldValidator屬性
2.1 ErrorMessage=要顯示的內容
2.2 ControlToValidate=要驗證的物件名稱(TextboxIDName)
補充:
如果不是所有button都要自動驗證動作 ,在該button之屬性設CausesValidation="False"即可。


沒有留言:
張貼留言