473,416 Members | 1,541 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,416 software developers and data experts.

Custom Validation with client and server side functions

I've set up a CustomValidator control which has both a client side and server
side function associated with it. My server side function never seems to be
called as long as I have the "EnableClientScript" property set to true. As
soon as I set this property to false , my server side function is called and
works fine. From reading the help, it was my understanding that the server
side function should be called even if I have a client side script. What am
I missing?

I also read that the customValidator is not called if there is no data in
the controlToValidate (textbox for example). Do people usually just assign
two validators to the control? Is it possible to create your own custom
control , derived from a "RequiredFieldValidator" that would also call a
server side function?

Thanks for the help.

--
Andre

Nov 19 '05 #1
2 1885
"Andre" <An***@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
I've set up a CustomValidator control which has both a client side and
server
side function associated with it. My server side function never seems to
be
called as long as I have the "EnableClientScript" property set to true. As
soon as I set this property to false , my server side function is called
and
works fine. From reading the help, it was my understanding that the
server
side function should be called even if I have a client side script. What
am
I missing?

I also read that the customValidator is not called if there is no data in
the controlToValidate (textbox for example). Do people usually just
assign
two validators to the control? Is it possible to create your own custom
control , derived from a "RequiredFieldValidator" that would also call a
server side function?


I usually use a RequiredFieldValidator in addition to whatever other
validators I need.

John Saunders
Nov 19 '05 #2
Yes, you can use more than one validator on for a control, such as the
RequiredFieldValidator and the CustomValidator.

If your client side script determines the user's data is invalid, the page
will never post back so your server side validation won't fire.
If the client side script considers the data to be valid then the page
should post back normally and your server side validatiton routine should be
fired.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Andre" <An***@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
I've set up a CustomValidator control which has both a client side and
server
side function associated with it. My server side function never seems to
be
called as long as I have the "EnableClientScript" property set to true. As
soon as I set this property to false , my server side function is called
and
works fine. From reading the help, it was my understanding that the
server
side function should be called even if I have a client side script. What
am
I missing?

I also read that the customValidator is not called if there is no data in
the controlToValidate (textbox for example). Do people usually just
assign
two validators to the control? Is it possible to create your own custom
control , derived from a "RequiredFieldValidator" that would also call a
server side function?

Thanks for the help.

--
Andre

Nov 19 '05 #3

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

Similar topics

1
by: Serdar Kalaycý | last post by:
I added a custom validator and added some code to its ServerValidate event but when a data which is not accepted is entered, it gives the warning as it should do, but doesn't stop the execution of...
2
by: Chris Barrow | last post by:
Hi everyone, Does anyone know if it is possible to append your own javascript function onto the end of a button's onclick method when validation controls are used? Here is an example of the...
4
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
2
by: TIBM | last post by:
Hi. I've posted this question on another newsgroup, but I haven't received any answers.. I have a login page where users input userID and password and click a Login button. Before calling the ...
2
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post...
6
by: jk | last post by:
Looking through WebUIValidation.js, I discovered that the standard validators don't cater for non-numeric date formats (e.g. dd-MMM-yyyy) which I would like to do To keep code to a minimum, I...
2
by: Alan Silver | last post by:
Hello, I have a custom validator on my page, and have the server-side code working fine. I want to add a client-side funtion as well, but am not sure how to wire it in so that it works with the...
8
by: Radu | last post by:
Hi. I have an ASP control on my page: <asp:Calendar ID="calStart" ................ Etc </asp:Calendar> and I have a Custom Validator defined as <asp:CustomValidator
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...
0
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...

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.