ASP.NET: only validate when submit button is clicked

I have an ASP.NET input form that has multiple controls configured. The form also includes a display of previous records, each with a LinkButton control that acts as a delete button. The problem is that when the LinkButton is clicked, validation is performed on the input part of the form, failures and deletions are not handled. I have not written this form and I am not doing control validation and I am just adding delete buttons, so how would I work on this?

+2


source to share


2 answers


Sets reasons to be false for the control in question?



+5


source


Are you saying that there are buttons on the form that, when clicked, trigger a validation ... and that those buttons shouldn't generate 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 participating in validation (this includes buttons that reset validation).

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

Check this link:



http://www.w3schools.com/ASPNET/prop_webcontrol_imagebutton_validationgroup.asp

and

http://www.dotnet-guide.com/validationgroups.html

0


source







All Articles