Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Short circuiting validation controls

Reply
Thread Tools

Short circuiting validation controls

 
 
Pho Bo Vien
Guest
Posts: n/a
 
      04-27-2004
I have several link buttons on a page and many validation controls.

I want the validation controls to block the user from submitting the
form unless their conditions are satisfied -- however, the controls seem
to block all eventHandlers that are connected to link buttons.

How can I distinguish which events the validation controls are to apply
-- or can I /short-circuit/ the validation controls in my other link
button event methods ?

 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      04-28-2004
Yes, set the CausesValidation property to false for the buttons where
you do not need validation. The default is true.

HTH,

--
Scott
http://www.OdeToCode.com

On Tue, 27 Apr 2004 23:32:24 GMT, Pho Bo Vien <>
wrote:

>I have several link buttons on a page and many validation controls.
>
>I want the validation controls to block the user from submitting the
>form unless their conditions are satisfied -- however, the controls seem
>to block all eventHandlers that are connected to link buttons.
>
>How can I distinguish which events the validation controls are to apply
>-- or can I /short-circuit/ the validation controls in my other link
>button event methods ?


 
Reply With Quote
 
 
 
 
WJ
Guest
Posts: n/a
 
      04-28-2004
You may consider casting the event sender and evaluate linkButton ID
property and fire codes accordingly.
Example: on the click event of "LinkButton1_Click(object sender,....)", you
would do something like:

LinkButton lb=(LinkButton)sender;
string s=lb.ID.ToString();
if(s=="Go Eat PHO")
{
//place codes here to verify/validate your wallet to ensure you have
enough $$$ to buy PBV.
if(YouDoNotHaveSufficient$$$)
{
set your LinkButtonToEatPho.Enabled to False ....;
}
else GoEatPBV();
}
else if so on ....
{
}

John


"Pho Bo Vien" <> wrote in message
news: s.com...
> I have several link buttons on a page and many validation controls.
>
> I want the validation controls to block the user from submitting the
> form unless their conditions are satisfied -- however, the controls seem
> to block all eventHandlers that are connected to link buttons.
>
> How can I distinguish which events the validation controls are to apply
> -- or can I /short-circuit/ the validation controls in my other link
> button event methods ?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Short-circuiting in C Billy Mays C Programming 63 08-28-2012 06:54 AM
avoid import short-circuiting Andrea Crotti Python 0 03-16-2012 04:49 PM
short-circuiting any/all ? kj Python 11 03-23-2010 10:55 AM
Is there a short-circuiting dictionary "get" method? Dave Opstad Python 16 03-11-2005 10:47 AM
Short circuiting.. ram C Programming 3 04-09-2004 07:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57