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

Custom Validator is not invoking the ServerValidation function

I am using the onServerValidate of CutomValidator. I have got the Calender control and a text control. When user pick the date from calender conrol and value goes in the text box. Now I have to validate the value entered by the user to check if it is a valid Date and and if the date is in specific range. So I am trying to validate it on server side using onServerValidate, but for somereason the custom validator is not invoking my server validation function.

My custom validator looks like
<asp:CustomValidator ID ="cvCalendar" runat="server" ControlToValidate ="txtCalendar" EnableViewState ="true" ValidateEmptyText ="true" ErrorMessage ="Validation Failed" ClientValidationFunction ="convertDatetoGB" ValidationGroup="txtVAlidate" Display ="Dynamic" />

and in code behind i have the following sub
Protected Sub serverDateValidation(ByVal source As Object, ByVal args As ServerValidateEventArgs) Handles cvCalendar.ServerValidate
''my check are going here
End Sub

Any help to that will be much appreciated. Thanks in Advance
Oct 9 '07 #1
2 2067
kenobewan
4,871 Expert 4TB
Are you sure that serverDateValidation is not firing? Do you get any errors? My suggestion would be using client side validation.
Oct 9 '07 #2
In the server postback function code, before you process the date, just add condition...

If Page.IsValid = True Then

' Your code to process input

End If

Debug to see when server validation code is fired ... it will be after the above condition.

Hope it works!
Oct 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

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...
9
by: Alex Shirley | last post by:
Hi there I’m simply trying to check for a blank or empty value in a textbox on my webform. In this instance I do not want to use a requiredfieldvalidator, I want to use a customvalidator (as I...
1
by: Jim Heavey | last post by:
Can I create a generic Javascrip custom validator in which I can pass multiple parameters? Looking at examples, it does not appear that I can. I want to create a custom validator which will look...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
5
by: Mattyw | last post by:
Hi, I'm relatively new to Web Forms, I have been using Required Field Validators and Regular Expression Validators on a Web Form I am developing and everything works as expected using Visual...
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...
3
by: Andy | last post by:
Hi folks, I have a customvalidator control that works properly if it isn't contained in an ASP:TABLE. But, when I place it inside an ASP:TABLE, I find that _ServerValidate doesn't get fired,...
4
by: Rick | last post by:
Hello, I built a composite web control that has a textbox and a date control. added my custom control on a webform where there are other standard controls. Each control on the form has a...
3
by: r_ahimsa_m | last post by:
Hello, I am learning JavaScipt. I have written some functions and I verified my code using http://www.jslint.com/ validator. I don't understand the problems it reports. Could you help me please...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.