Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have used a Calender Extender in a TextBox and for the same textbox i have RequiredFieldValidator.My requirement now is when i click on a button it should ignore the textbox ,value not required for the text box on that button click

could you please advice


Thanks
Posted

Hi,
try to set the button "cause validation" property to false. and if it did not work try to set a validation group for the button.
 
Share this answer
 
Comments
Lancy.net 18-Nov-11 22:15pm    
Thanks
Ur Answer should be put Setfocuserror=False don't use Control to validate field
 
Share this answer
 
Leave the button and the validation group as they are if you only want one validator to be disabled while leaving the others active. In that case you can simply set the 'Enabled' property of the validator you want to disable to false, as with any other component.
 
Share this answer
 
Set the Button CauseValidation property " False "
 
Share this answer
 
If the groups are different for the validator and the button then use javascript tot disable that validator on button click.
 
Share this answer
 
if you use validation group for validation controls
 
Share this answer
 
Then why should you need a validator remove that or just ignore that corresponding validator on button click as follows

C#
yourvalidatorname.Enabled=false;
 
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