<asp:RegularExpressionValidator
ID="RegularExpressionValidator1"
CssClass="error"
SetFocusOnError="true"
runat="server"
ErrorMessage="Error.."
Display="Dynamic"
ControlToValidate="txttextbox"
ValidationExpression="^[0-9]+\.[0-9]{1}$"
ValidationGroup="insert">
答案 0 :(得分:0)
试试这个
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1"
CssClass="error"
SetFocusOnError="true"
runat="server"
ErrorMessage="Error.."
Display="Dynamic"
ControlToValidate="txttextbox"
ValidationExpression="^\d{1}(\.\d{0,1})?$"
ValidationGroup="insert">