2.0: CompareValidator with Type

  • Thread starter Thread starter R.A.M.
  • Start date Start date
R

R.A.M.

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/
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top