C# – How to bypass validation for a button in ASP.NET

asp.netcvalidation

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?

Best Answer

Set the CausesValidation property to false.