Question

I have a scenario where I'm using a newly added ValidationSummary control. The form that I am working on has multiple buttons (customer search, submit, etc). Is it possible to fire the ValidationSummary only when the user clicks the submit button, as opposed to the customer search button?

Was it helpful?

Solution

On the Customer Search button, add "CausesValidation='False'"

OTHER TIPS

The best and most general way to do this is to assign a value to the ValidationGroup property for the summary and all the controls which are to be validated, as well as the submit button. Only controls with the same ValidationGroup are affected.

Using validation groups, you can have different parts of a page validate without affecting each other. This feature was introduced with ASP.NET 2.0 by popular demand.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top