</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="RegularExpressionValidatoradd" runat="server" ValidationExpression="" ControlToValidate="textboxadd" ErrorMessage="Enter Valid address!" >
</asp:RegularExpressionValidator>
我不想要这些字符~`!@ $%^ * + =} {[]“:;?&gt;&lt;在我的textboxadd中。现在我应该在ValidationExpression中写什么=”“
答案 0 :(得分:0)
试试这个
</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="RegularExpressionValidatoradd" runat="server" ValidationExpression="\d{1,5}\s\w.\s(\b\w*\b\s){1,2}\w*\." ControlToValidate="textboxadd" ErrorMessage="Enter Valid address!" >
</asp:RegularExpressionValidator>
<强>(或)强>
</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="RegularExpressionValidatoradd" runat="server" ValidationExpression="[0-9a-zA-Z #,-]+" ControlToValidate="textboxadd" ErrorMessage="Enter Valid address!" >
</asp:RegularExpressionValidator>