J
JimLad
Hi,
ASP.NET 3.5
We are creating a 3-tier ASP.NET Web Application that needs just to
understand dates as UK shortdate format (dd/MM/yyyy). It will only be
used in the UK on intranet. I often come across web server and client
machine that are incorrectly set up so I want to protect the app from
these incorrectly set up hosts.
I understand the safe date formats for passing through to the
database. SQLParameters pass through a non-ambiguous format and also
that 'yyyyMMdd' is also a safe format. So ignore the database side of
things - I get that.
At the moment all the bound controls are done as follows:
<%# Bind("spouse_date_of_birth","{0:dd/MM/yyyy}") %>
This nicely controls the inputs, but would it be better to put the
following line in web.config:
<globalization uiCulture="en" culture="en-GB" />
and then specify the short date format on the page:
<%# Bind("spouse_date_of_birth","{0:d}") %>
Also, if we fail to convert all strings in the UI layer and then
convert them in the BLL or DLL layer, what culture would those
assemblies/DLLs use in the date conversion? Do they use the values
specified in the web.config or do you specify them separately?
One thing I am sure about is that I want to isolate the ASP.NET app
from the culture settings on the web server and the client machine.
Cheers,
James
ASP.NET 3.5
We are creating a 3-tier ASP.NET Web Application that needs just to
understand dates as UK shortdate format (dd/MM/yyyy). It will only be
used in the UK on intranet. I often come across web server and client
machine that are incorrectly set up so I want to protect the app from
these incorrectly set up hosts.
I understand the safe date formats for passing through to the
database. SQLParameters pass through a non-ambiguous format and also
that 'yyyyMMdd' is also a safe format. So ignore the database side of
things - I get that.
At the moment all the bound controls are done as follows:
<%# Bind("spouse_date_of_birth","{0:dd/MM/yyyy}") %>
This nicely controls the inputs, but would it be better to put the
following line in web.config:
<globalization uiCulture="en" culture="en-GB" />
and then specify the short date format on the page:
<%# Bind("spouse_date_of_birth","{0:d}") %>
Also, if we fail to convert all strings in the UI layer and then
convert them in the BLL or DLL layer, what culture would those
assemblies/DLLs use in the date conversion? Do they use the values
specified in the web.config or do you specify them separately?
One thing I am sure about is that I want to isolate the ASP.NET app
from the culture settings on the web server and the client machine.
Cheers,
James