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

DataTypeCheck in comparevalidator control

Hi.

I set a CompareValidator using DataTypeCheck = Integer to validate a
textbox. When I type 199b on the textbox, the validator control accepts
the value.

If I set the same validator control using DataTypeCheck = Double, the
value 199b is refused by the validator.

This textbox needs to accept numbers only. What is the difference
between Integer and Double in this case? Should I use a
RegularExpressionValidator?

Regards,
Chris Leffer

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
1 1972
This example shows you how to create a textbox that permits only numeric
characters to be entered:
http://SteveOrr.net/articles/InheritAndExtend.aspx

Here's more info on the details of how the validation controls work:
http://SteveOrr.net/articles/Validation.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Chris Leffer" <ch****@wank.com> wrote in message
news:eh**************@TK2MSFTNGP09.phx.gbl...
Hi.

I set a CompareValidator using DataTypeCheck = Integer to validate a
textbox. When I type 199b on the textbox, the validator control accepts
the value.

If I set the same validator control using DataTypeCheck = Double, the
value 199b is refused by the validator.

This textbox needs to accept numbers only. What is the difference
between Integer and Double in this case? Should I use a
RegularExpressionValidator?

Regards,
Chris Leffer

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2

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

Similar topics

1
by: edi | last post by:
Hi, Are there any differences between CompareValidator.ControlToCompare and CompareValidator.ControlToValidate? For example if I have TextBox controls: TextBox1 and TextBox2 what are the...
4
by: Axel Dahmen | last post by:
Hi, I've got the same problem as described below. No answer found yet. Can someone please help? (I'm using .NET 1.0 on my development machine and 1.1 on my webserver. Like Susanna, I only get...
0
by: RSB | last post by:
Hi Everyone, I am using comparevalidator with Operator DateTypeCheck. And recently i have chenged my devlopment machine.. So on my First Machine the validatod was validating the Date with the...
1
by: Keith Spitz | last post by:
The following works... <asp:CompareValidator Runat="server" ControlToValidate="txtValue" Text="*" ErrorMessage="The value you provided is not of the correct type." Operator="DataTypeCheck"...
1
by: Joe | last post by:
Hello, I am new to asp.net. I have created a login page using dotnet. I am using CompareValidator but noticed that when I click on View Source in the browser I see the value assigned to...
2
by: Eric Maia | last post by:
I have a textbox (StartDateTextBox) in a UserControl on my page, that is supposed to have a date entered into it. I have a RequiredFieldValidator that has its ControlToValidate property set to the...
1
by: Ron Weldy | last post by:
I want to have a optional field on a form that can be blank but if the user enters something, it must be a number. I'm using a CompareValidator with the datatype check but if I submit the form with...
0
by: weilinyu | last post by:
Hi Everyone, I have a web portal. On one of my web forms, I have a Comparevalidator for my textbox "FuellingDate". I configured it to do a DataTypeCheck for Date. When user puts in a date in a...
1
by: R.A.M. | last post by:
Hello, I am learning ASP.NET 2.0 and I have a problem with CompareValidator control. On .aspx page I have a control: Date of birth: <asp:TextBox ID="BirthDate" runat="server"...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.