I am using VWD 2005 Express SP2 with C# and SQL 2005 Express on Windows XP Pro SP2.
I have some years of experience, but only 2 months ASP.NET and VWD.
This is quite a long post, but stick with me, I have already read the documentation and searched the web, searched the forums, tried several "solutions" that didn't work.
I have a problem with British/UK/en-GB date formats. Yes I know, there have been a lot of posts about that, and I have studied them.
I want dates to display as dd/mm/yy but they default to mm/dd/yy, US style.
In SQL studio, the dates display as dd/mm/yyyy, which is fine.
In VWD - Database Explorer - Show Table Data - the dates display as dd/mm/yyyy, which is fine.
When I use {0:d} format strings, the dates display as mm/dd/yy, US style.
In the web.config I added a line
<globalization uiCulture="en-GB" culture="en-GB" />
It made no difference at all.
In the page Directive, I added uiCulture="en-GB" culture="en-GB"
No effect at all.
I added a couple of lines:
this.lblCulture.Text = "Culture is set as " + System.Globalization.CultureInfo.CurrentCulture.EnglishName.ToString();
this.lblUICulture.Text = "UICulture is set as " + System.Globalization.CultureInfo.CurrentUICulture.EnglishName.ToString();
They both return "English (United Kingdom)"
But on that same page, dates with format {0:d} display as mm/dd/yy, like 03/25/07.
I have tried putting formats like {0:dd/MM/yy} on all the pages, in the gridviews, detailviews, formviews etc.
They display the dates correctly, which is fine, and nearly solves my problem because the app is only for use in the UK.
BUT although the dates are displayed correctly, we when you try to update a record, the dates are rejected as invalid formats.
In a DetailView, with ItemTemplate, EditTemplate and InsertTemplate for the same field all specifying dd/MM/yy,
the date is displayed as 25/03/07. Great!
But we cannot ENTER a date in that format.
On the edit/update page, the date is displayed as 25/03/07, but if you change it to 26/03/07, say, the comparison validator rejects the date format. If you retype it as 3/25/07, it is accepted. Despite the {0:dd/MM/yy} format in the EditTemplate.
Unfortunately, Joe Public will not like that.
There are dozens of pages that display data with dates, so I went back to square one.
New site, one page, with a detailsview and datasource to display and update a text field and a date, using {0:d} format.
The new site had no culture settings on the page or in the config file.
In the VWD browser it worked perfectly.
Date displays as 25/03/07, and I can change it to 26/03/07.
Wonderful!
Success!
But when I started IE7 and went to localhost/mysite, it displayed 03/25/07.
I added culture and UICulture settings to the config file and page, no difference.
I made three version of my new simple page - one with plain vanilla detailsview fields with
{0:d}, one page with template fields with {0:d}, and one page with template fields with {0:dd/MM/yy}.
All three look right and work right inside VWD.
In IE7, the {0:d} fields show as MM/DD/YY.
The {0:dd/MM/yy} version display dd/mm/yy, but updates fail validation,
you have to retype 27/03/07 as 3/27/07. (In IE7).
In Windows Control panel Regional and Language settings = English (United Kingdom).
In IE7 - Tools - Internet Options - Languages = English (United Kingdom) [en-gb]
In Microsoft Office - Language = English (United Kingdom)
But In VWD -> Help, -> ShowInfo -> Summary
Locale = United Kingdom
Internet Explorer - Summary - Language = English (United States)
Microsoft Office - Summary - Language = English (United States)
VWD has only two options for language - "English" (just the one word)
or "Same as Windows". I tried them both, doesn't seem to make any difference.
I should also mention that if I set my web.config files like the starter kits,
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
I get messages "could not find schema information .... " for everything in the config file.
(There are many posts about this too).
If I change that to just <configuration> the messages go away, but it makes no difference
to the results either in the VWD browser, pane or in IE7.
Like I said at the start, I already did read the documentation, and I have gone round the same circles several times now.
Any suggestions?
If a post helps to solve your problem, please click the Answer button on that post.
I'm still confused, but now I'm confused on a higher plane.