I have an ASP.NET form that takes input from a user. There's a Submit
button on the form and a button called Calc
which does a calculation to populate a text field. The problem I'm having is that on the form I have a set of <ASP:REQUIREDFIELDVALIDATOR>
validators and when the Calc
button is pressed the form gets validated. I don't want the required fields to be validated when the Calc
button is pressed, only the Submit
button. Any way around this?
C# – How to bypass validation for a button in ASP.NET
asp.netcvalidation
Related Topic
- C# – How to enumerate an enum
- Regex – How to validate an email address using a regular expression
- Jquery – How to format a Microsoft JSON date
- C# – What are the correct version numbers for C#
- C# – Path.Combine for URLs
- C# – How to generate a random int number
- Html – An invalid form control with name=” is not focusable
Best Answer
Set the
CausesValidation
property to false.