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 ?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 <jabailo@.earthlink.net>
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 ?
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" <jabailo@.earthlink.net> wrote in message
news:3126f861122780e8a3a47f73733c5ed2@.ne
ws.teranews.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 ?
>
Thursday, March 22, 2012
Short circuiting validation controls
Labels:
asp,
block,
buttons,
circuiting,
controls,
link,
net,
page,
submitting,
theform,
unless,
user,
validation
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment