Can I prevent RequiredFieldValidation from triggering against postbacks from a specific control.

Posted by marcusstarnes on Stack Overflow See other posts from Stack Overflow or by marcusstarnes
Published on 2010-05-26T09:58:02Z Indexed on 2010/05/26 10:21 UTC
Read the original article Hit count: 210

I have a web form with a number of textbox controls which I've associated RequiredFieldValidator's with. I have a ValidationSummary control on the page to render any incomplete fields when I submit the page.

However, I've just had to add an image upload facility to the same page, and have an 'Upload' button which I have posting back to perform the upload. I don't want this upload button to trigger the RequiredFieldValidators for the rest of the page though - I want this upload postback to be ignored as far as the validation goes.

What's the best way to stop the RequiredFieldValidator's from firing when I submit this upload button on the page because at the moment, the upload won't occur unless I have first field out all of the other textbox controls on the page.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about validation