I have an ASP.NET entry form where several controls have validation set up. The form also includes a display of previous records, each with a LinkButton control that acts as a delete button. Problem is when a LinkButton is clicked, it performs validation on the entry portion of the form, fails, and the delete is not processed. I didn't write this form and I'm not up on the validation controls, and I'm just adding the delete buttons, so how would I work around this?

+2  A: 

Set CausesValidation to false for the control in question?

Adding to clarify... Set CausesValidation = false on the LinkButtons.
David Stratton
Ah, of course. You learn something new everyday. Thanks.
Michael Itzoe
mike click on the actual link button control and look at the properties for this control. One of those properties is CausesValidation and by default it is set to true. Just change it to false. Sorry for being brief.


Are you saying that there are buttons on the form that when clicked are causing validation to take place...and that these buttons should not peform the validation?

If so, then you probably need to group all the controls and buttons that are part of the validation. To do this you set the 'ValidationGroup' property for each control involved in the validation (this includes the buttons that fire off the validation).

This should stop buttons that are not part of the validation, firing the validation process.

Check this link out: