範例:驗證只能整數值
< asp:RegularExpressionValidator ID="revdelevercopysnum" runat="server" Display="Dynamic" ControlToValidate="tbx_delevercopysnum"
Text="請輸入整數" ValidationExpression="^(([1-9](\d{1,4})?)|( 0))$">
< /asp:RegularExpressionValidator>
RegularExpressionValidator的基本的特殊定義字元可參考:
http://tw.myblog.yahoo.com/fish-weep/article?mid=614&prev=615&next=599
而之前提到的CustomValidator和RequiredfieldValidator,這三個差別,可參考:
http://msdn.microsoft.com/zh-tw/library/system.web.ui.webcontrols.basevalidator%28VS.80%29.aspx
感謝Panda建議