473,387 Members | 3,820 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.

Validating dates with a CompareValidator

Hi there,

According to the following article, a textbox for a date entry field can be
validated with a CompareValidator:

http://msdn.microsoft.com/library/de...stdatatype.asp

My question is: which date format would the validator consider correct, the
one on the web server or the one on the browser's client computers?

Thanks in advance,

-Jorge
Nov 18 '05 #1
1 1650
The server dictates format. It always uses the ShortDatePattern and
DateSeparator properties of the CultureInfo.DateTimeFormatInfo object that
is running with the current thread.

Remember that client-side validation is a bonus. Server side validation is
manditory because many browsers don't support client-side validation. (Only
DHTML browsers like IE and IE/Mac support client-side.) Since the server
cannot know what format the client is using, it must dictate to the user the
format. Often web sites determine the user's format by asking them to
specify their language or culture. They can also check the
Request.UserLanguages property.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jorge EA" <co**********@hotmail.com> wrote in message
news:2p************@uni-berlin.de...
Hi there,

According to the following article, a textbox for a date entry field can
be
validated with a CompareValidator:

http://msdn.microsoft.com/library/de...stdatatype.asp

My question is: which date format would the validator consider correct,
the
one on the web server or the one on the browser's client computers?

Thanks in advance,

-Jorge

Nov 18 '05 #2

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

Similar topics

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...
4
by: John | last post by:
Hi I have a web control text box on my webform which I want to use for entering dates. Is there a way to validate this text box field for valid dates? May be using a validators such as regular...
0
by: gauthier | last post by:
Hi, I'm developing a web application available in multiple languages. When we switch language (via a drop down list), we switch the culture of the current thread: ...
1
by: panche | last post by:
I'm developing a fairly simple user control that has two textboxes for date/time entry (a from date/time and a to date/time). One of my requirements is that there should be no button that sets...
11
by: tshad | last post by:
I have 4 dropdown boxes (fromDay, fromMonth, ToDay and ToMonth) I want to be able to test to make sure that the dates are valid and the the From dates are < the To dates. When I add the...
2
by: Patrick.O.Ige | last post by:
I'm using this CompareValidator to validate dates but my default its mm/dd/yyyy <asp:CompareValidator ControlToValidate="DOB" Display="Dynamic" Text="Invalid birth date!" Operator="DataTypeCheck"...
3
by: THaskell | last post by:
I am using a comparevalidator to make sure that a date for a scheduling app is not in the past. <asp:CompareValidator id="cvSD" runat="server" ControlToValidate="txtStartDate"...
1
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have a textBox Where I type date. I want to validate it. Im using customValidate controls. I have this function in my code behind page void DatesValidate(object source,...
2
by: Just Me | last post by:
Hi people. I am attempting to determine how best to prevent a users date entry in an update action from causing a format exception. The dates are UK, but the user may try to put in a 'US'...
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
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
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...

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.