Thursday, March 29, 2012

OnServerValidate

I have 2 buttons on my ASP.NET page, one to Submit the user details and
1 to bring up a calendar. On the page I also have a custom validator
which calls a procedure via OnServerValidate.

The problem I have is that pressing the other button also triggers the
OnServerValidate. Does anybody know how I can stop this from happening?

Thanks,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!"Mike P" <mrp@.telcoelectronics.co.uk> wrote in message
news:eIZyPSWmDHA.2268@.TK2MSFTNGP12.phx.gbl...
> I have 2 buttons on my ASP.NET page, one to Submit the user details and
> 1 to bring up a calendar. On the page I also have a custom validator
> which calls a procedure via OnServerValidate.
> The problem I have is that pressing the other button also triggers the
> OnServerValidate. Does anybody know how I can stop this from happening?
>
> Thanks,
> Mike

Property: CausesValidation = false
on the "calendar button"
You need to set the CausesValidation Property of the button object.
It should do the trick for you.

--
Patrik Lwendahl
cshrp.net - ' Elegant code by witty programmers '
cornerstone.se - ' IT Training for proffesionals '

"Mike P" <mrp@.telcoelectronics.co.uk> wrote in message
news:eIZyPSWmDHA.2268@.TK2MSFTNGP12.phx.gbl...
> I have 2 buttons on my ASP.NET page, one to Submit the user details and
> 1 to bring up a calendar. On the page I also have a custom validator
> which calls a procedure via OnServerValidate.
> The problem I have is that pressing the other button also triggers the
> OnServerValidate. Does anybody know how I can stop this from happening?
>
> Thanks,
> Mike
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

0 comments:

Post a Comment