473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Short circuiting validation controls

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 ?

Nov 18 '05 #1
2 1028
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 <ja*****@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 ?


Nov 18 '05 #2
WJ
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" <ja*****@earthlink.net> wrote in message
news:31******************************@news.teranew 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 ?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Dave Opstad | last post by:
In this snippet: d = {'x': 1} value = d.get('x', bigscaryfunction()) the bigscaryfunction is always called, even though 'x' is a valid key. Is there a "short-circuit" version of get that...
3
by: ram | last post by:
hi all, apart from readability, and not wanting the otherwise different statements to be assumed as one single loong statement what are the pros/cons of both snippets? i tried this out on a...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
6
by: Stephen | last post by:
Hi, the validation controls dont work on Netscape or Mozilla and only on Internet Explorer why? How do i correct this problem? Thanks
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
6
by: Raymond Lewallen | last post by:
I understand the differences between And and AndAlso and the differences between Or and OrElse. Under what circumstance would you NOT use short-circuiting when evaluating expressions? It seems to...
5
by: Phil Jones | last post by:
I'm just (as a matter of course) using AndAlso and OrElse statements to short circuit checking, even for nominal things like Boolean comparisons. I'm wondering, is that a good thing to do (for...
0
by: dhurwitz | last post by:
Hi, In my ASP.NET 2.0 web app, I have a user control, ucBinEdges, with several text boxes. The user control has several validation controls validating the Text of these text boxes -...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.