469,645 Members | 1,105 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

2.0: CompareValidator with Type

Hello,
(Sorry for my English...)
Could you help me please? I have a problem with CompareValidator
control which makes the load of my page infinitive. Here's the code:

Date of birth: <asp:TextBox ID="BirthDate" runat="server" />
<asp:CompareValidator ID="BirthDateValidation" runat="server"
ControlToValidate="BirthDate" Type="Date"
Text="Enter date of birth!" /><br />

Without CompareValidator pages loads correctly. After adding this
control load process does not end.
Could you explain me the problem please?

Thank you very much!
/RAM/
Apr 26 '06 #1
1 1314
You need to set the Operator property as DataTypeCheck for the
CompareValidator to work.
Also remember the CompareValidator will not be fired if your textbox is left
empty. You will be better off adding the requiredfieldvalidator in addition
to the CompareValidator

HTH

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services


"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:r1********************************@4ax.com...
Hello,
(Sorry for my English...)
Could you help me please? I have a problem with CompareValidator
control which makes the load of my page infinitive. Here's the code:

Date of birth: <asp:TextBox ID="BirthDate" runat="server" />
<asp:CompareValidator ID="BirthDateValidation" runat="server"
ControlToValidate="BirthDate" Type="Date"
Text="Enter date of birth!" /><br />

Without CompareValidator pages loads correctly. After adding this
control load process does not end.
Could you explain me the problem please?

Thank you very much!
/RAM/

Apr 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sjaakie Helderhorst | last post: by
4 posts views Thread by Axel Dahmen | last post: by
1 post views Thread by Ron Weldy | last post: by
reply views Thread by R.A.M. | last post: by
1 post views Thread by R.A.M. | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.