By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,965 Members | 1,739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,965 IT Pros & Developers. It's quick & easy.

How to Ignore the RequiredFieldValidator when i click on Cancel.

P: n/a
RSB
Hi every one ,

i am creating this form and i have two asp:Linkbuttons one for save and one
for Cancel.

Now i also have some RequiredFieldValidators on this Form and i only want to
Execute those once i click on Save but not when i click Cancel.

Also for the Cancel button i am executing some code at the Server to take
some actions.

please help.
Thanks

RSB
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
this question was asked yesterday i guess..
set CausesValidation property to false for that button.

Av.
"RSB" <rs*****@hotmail.com> wrote in message
news:kL****************@news.cpqcorp.net...
Hi every one ,

i am creating this form and i have two asp:Linkbuttons one for save and
one
for Cancel.

Now i also have some RequiredFieldValidators on this Form and i only want
to
Execute those once i click on Save but not when i click Cancel.

Also for the Cancel button i am executing some code at the Server to take
some actions.

please help.
Thanks

RSB

Nov 18 '05 #2

P: n/a
Hi RSB,

The solution is again very simple. If you are dont want to execute any
validators getting fired you can set the causes validation to false for the
cancel linkbutton, this will allow you to post the form without the
validators getting fired.

You may also try disabling the validators which you dont want to get fired
on client side using javascript on the click of cancel link button. This
exercise of disabling the validators you also need to do on the
btncancel_click on server and proceed with what all validations you want to
do on the server.

HTH
Regards
Ashish M Bhonkiya

"RSB" <rs*****@hotmail.com> wrote in message
news:kL****************@news.cpqcorp.net...
Hi every one ,

i am creating this form and i have two asp:Linkbuttons one for save and one for Cancel.

Now i also have some RequiredFieldValidators on this Form and i only want to Execute those once i click on Save but not when i click Cancel.

Also for the Cancel button i am executing some code at the Server to take
some actions.

please help.
Thanks

RSB

Nov 18 '05 #3

P: n/a
Set the CausesValidation property of the Cancel button to false .
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.