Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have an issue.I have a webform,where i have given certain requiredField validators.When I click on my add button present in the webform .it ll show all the validations messages beside the text boxes.But what I want is the validation messages should be shown only when I click on the Submit button present in my webform.so that User can know if he misses anything?Is there any way ,Plaease tell me?
Posted

1 solution

.Net controls have a property named CausesValidation. If you don't want the validators to fire when clicking a certain button, just set its CausesValidation property to false.

https://msdn.microsoft.com/en-us/library/system.windows.forms.control.causesvalidation(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900