On 21 Mar, 19:28, "Just Me" <news.microsoft.comwrote:
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' format.
I have a datasource which is wired to my DAL/update function.
1.) On the server side.
Where do I need to check this ?
2.) On the client side.
If I wanted to set up JSCRIPT validation, whats the best way to acheive this
?
I dont neccesarilly need fine detail, but a broad brush roadmap of what to
do and Ill work it out from there.
Thanks. !
Hi
Use a CompareValidator control for a client-side check prior to
postback. Set the 'operator' (properties window) property to
DataTypeCheck. You can use this in conjunction with a RangeValidator
to filter on the required period if applicable.
Unfortunately there is no way to guarantee day/month v month/day
ambiguity for text input. Most web sites that require date input use
drop-down lists for day and month instead.
Alternatively use the ASP.NET calendar control. They require more
space on the page and can generate a lot of round trips during the
selection process but are user friendly and easy to work with on the
development side.
HTH