473,503 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation Question

Hi there,

I have a question.

I have a webform with 2 buttons and 2 customvalidators.

I need Customvalidators to validate user input against a database.

Depending on the button I click, I want only the associated validator to
perform the check. Is there a way to know what button has been clicked
in the servervalidate event so that I can avoid the wrong validator to
check data?

Thanks in advance.
Stefano Mostarda,
Rome Italy
Nov 18 '05 #1
1 1126
It sounds like you aren't dealing with client-side validation. That makes
your life easier.

1. Set the button's CausesValidation property to false. That will prevent
the automatic execution of Page.Validate()
2. In your Click event, call the appropriate validator's Validate() method.
Then test if all of them passed by testing the validator's IsValid property.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More",
http://www.peterblum.com/vam/home.aspx

"Stefano Mostarda" <st**************@fastwebnet.it> wrote in message
news:uj**************@tk2msftngp13.phx.gbl...
Hi there,

I have a question.

I have a webform with 2 buttons and 2 customvalidators.

I need Customvalidators to validate user input against a database.

Depending on the button I click, I want only the associated validator to
perform the check. Is there a way to know what button has been clicked
in the servervalidate event so that I can avoid the wrong validator to
check data?

Thanks in advance.
Stefano Mostarda,
Rome Italy

Nov 18 '05 #2

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

Similar topics

2
2132
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
9
2327
by: rbronson1976 | last post by:
Hello all, I have a very strange situation -- I have a page that validates (using http://validator.w3.org/) as "XHTML 1.0 Strict" just fine. This page uses this DOCTYPE: <!DOCTYPE html PUBLIC...
16
2192
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
1
1613
by: Colin Basterfield | last post by:
Hi, I have a web form which takes daily sales totals, both counts and monetary value and is done on a weekly basis, so on a Monday morning the User would enter these totals. Each total has a...
14
6268
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)...
5
3223
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
8
1191
by: Joe | last post by:
Hi, I have a form with three text fields and a Submit button. The two text fields have ReqiredFieldValidator and third text field has RegularExpressionValidator. The page validation works fine...
2
9079
by: winnie_us99 | last post by:
Hi All, I am trying to do validation on my text field before going to the next page to create a user. It doesn't look like the next button will fire any validation. Am I missing something? Can...
9
4153
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
27
4679
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
0
7072
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.