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?
Adding to clarify... Set CausesValidation = false on the LinkButtons.
David Stratton
2009-10-01 19:10:31
Ah, of course. You learn something new everyday. Thanks.
Michael Itzoe
2009-10-01 19:14:28
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.
JonH
2009-10-01 19:14:32
A:
Hi
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:
http://www.w3schools.com/ASPNET/prop_webcontrol_imagebutton_validationgroup.asp
and
Dal
2009-10-01 19:09:22