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

CustomValidator problem...

RTT
It's my first time i want to write a cotum validator but it doesn't seem to
work. In de page i've put this validator:
<asp:CustomValidator id="CVFBeginDate"
OnServerValidate="CVFBeginDate_ServerValidate" runat="server"
ErrorMessage="Please fill in a valid date as startdate"
ControlToValidate="TxtBeginDate">*</asp:CustomValidator>

in de codebehindpage i have created this sub:
Protected Sub CVFBeginDate_ServerValidate(ByVal source As System.Object,
ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles
CVFBeginDate.ServerValidate
Try
tmp = args.Value.Split("/")
testDate = New Date(tmp(2).ToString(), tmp(1).ToString(),
tmp(0).ToString())
args.IsValid = True
Catch
args.IsValid = False
End Try
End Sub
it doesn't seem to work. do you have to put something special to the custom
validator?
Nov 21 '05 #1
1 1000
RTT
solved with page.isvalid to trigger validation
"RTT" <RT*@pandora.be> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
It's my first time i want to write a cotum validator but it doesn't seem to work. In de page i've put this validator:
<asp:CustomValidator id="CVFBeginDate"
OnServerValidate="CVFBeginDate_ServerValidate" runat="server"
ErrorMessage="Please fill in a valid date as startdate"
ControlToValidate="TxtBeginDate">*</asp:CustomValidator>

in de codebehindpage i have created this sub:
Protected Sub CVFBeginDate_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles
CVFBeginDate.ServerValidate
Try
tmp = args.Value.Split("/")
testDate = New Date(tmp(2).ToString(), tmp(1).ToString(),
tmp(0).ToString())
args.IsValid = True
Catch
args.IsValid = False
End Try
End Sub
it doesn't seem to work. do you have to put something special to the custom validator?

Nov 21 '05 #2

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

Similar topics

7
by: jcpmeticulus | last post by:
Hi I've spent the last day or so debugging a problem with a CustomValidator and am now totally stumped! Basically I use a number of CustomValidator's on my page, but have cut this down now to...
2
by: George Ter-Saakov | last post by:
Hi. I am fighting the CustomValidator strange behavior for second day already. I created some test project which is only to reproduce the problem. 1. I created UserControl which has an only a...
1
by: bill yeager | last post by:
I'm using the customvalidator in my web page. I get the following error when I try to run the web page: Unable to find control id 'lstRider' referenced by the 'ControlToValidate' property of...
10
by: Mr. x | last post by:
Hello, I have some code as follows. It seems that customValidator doesn't work - because i don't get any message. In the body : <asp:table> <asp:TableRow>
2
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a...
3
by: Ronan Dodworth | last post by:
Hi there I'm having a little bit of a problem with my customvalidator control. The problem is the javascript runs fine on my local webserver IIS but not when I post it to the web hosting server....
3
by: philipl | last post by:
hi, i have a textbox in my edititemtemplate in my datagrid. I have created a customvalidator for it, when i update the row the appropiate function gets called to customvalidate but the problem...
1
by: SMG | last post by:
Hi All. My forms has two textboxes, 1 username, 2 password. Both has requiredfield validator it works fine when there is no input in these textboxes. And the errorMsg is shown in...
2
by: Jeff | last post by:
hey net 3.5 I have problem with a customvalidator. I enter values into the TextBox named "txt" and clicks on the save button (ibSave) then the TestValidate method get triggered. TestValidate...
2
by: testemailsystem.test | last post by:
Hi everyone, I use CustomValidator with the server event onservervalidate (no javascript event). The scenario : The user filled the form and pressed SUBMIT. But because there was an error –...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.