Issue with Regular Expression Validator for text box in ASP.NET

前端 未结 2 2004
庸人自扰
庸人自扰 2021-01-27 15:37

Im having issues with the RegularExpressionValidator in my code!

I have 2 text boxes in my html page and in the code i have the sql command that inserts the parameters t

相关标签:
2条回答
  • 2021-01-27 15:57

    I checked everything and finally got it,

    I had to add to my web.config the following:

    <configuration>
      <appSettings>
        <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
      </appSettings>
    </configuration>
    

    And that solved my issues

    0 讨论(0)
  • 2021-01-27 15:57

    If you want to see a mark next to the field when validation fails, you should set the Text property of the validator:

    <asp:RegularExpressionValidator ID="rev1" runat="server" ControlToValidate="TextBox1" Text="*" />
    

    Also, if you want to see the error message, you must have a ValidationSummary in your form.

    0 讨论(0)
提交回复
热议问题