http://www.infini-tec.de/InfiniTec - Henning Krauses Blog - Two-way databinding with ASP.NET struggles with DateTime conversion2009-02-07T05:26:01+00:00Don't adjust your mind - it's reality that is malfunctioning Henning KrauseBlogEngine.Net Syndication Generatorhttp://www.infini-tec.de/opml.axdHenning KrauseDon't adjust your mind - it's reality that is malfunctioning en-USInfiniTec - Henning Krauses Blog 0.0000000.000000http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_a735ebb0-aa31-4767-bcc1-f5b2351bea97Sam on <a href="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_a735ebb0-aa31-4767-bcc1-f5b2351bea97" alt="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_a735ebb0-aa31-4767-bcc1-f5b2351bea97">Two-way databinding with ASP.NET struggles with DateTime conversion</a>2009-02-07T05:26:01+00:00Sam<cite title="Quote">One additional requirement for this error to happen is that the user local is set to non-english (respectively the invariant culture).</cite>
What do you mean non-english? Most of the English speaking countries in the world apart from the USA use a consistent date format (day/month/year or year/month/day).
If the web.config file is configured correctly to handle a localised date format, this error should not occur.
&amp;amp;lt;configuration&amp;amp;gt;
&amp;amp;lt;system.web&amp;amp;gt;
&amp;amp;lt;globalization culture=&amp;amp;quot;en-AU&amp;amp;quot; uiCulture=&amp;amp;quot;en-AU&amp;amp;quot; /&amp;amp;gt;
&amp;amp;lt;/system.web&amp;amp;gt;
&amp;amp;lt;/configuration&amp;amp;gt;
Furthermore, when the control is bound to a date field, a custom format string can be used to avoid this error.
&amp;amp;lt;%# Bind(&amp;amp;quot;...&amp;amp;quot;,&amp;amp;quot;{0:dd/MM/yyyy}&amp;amp;quot;) %&amp;amp;gt;
Upon updating or inserting, this format string should be used to parse the string to a date.2009-02-07T05:26:01+00:00Samhttp://www.infini-tec.de/pingback.axdhttp://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_a735ebb0-aa31-4767-bcc1-f5b2351bea97http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_a735ebb0-aa31-4767-bcc1-f5b2351bea97#commenthttp://www.infini-tec.de/syndication.axd?post=a735ebb0-aa31-4767-bcc1-f5b2351bea97http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_0e410a86-4ea4-4169-b7d9-b0769b7bc124gustavo castro on <a href="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_0e410a86-4ea4-4169-b7d9-b0769b7bc124" alt="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_0e410a86-4ea4-4169-b7d9-b0769b7bc124">Two-way databinding with ASP.NET struggles with DateTime conversion</a>2009-02-27T14:11:44+00:00gustavo castroEXCELLENT!!!!
I had the same problem and i was trying to solve it for a long time ....
thks...
(Microsoft should do something about this ...)2009-02-27T14:11:44+00:00gustavo castrohttp://www.infini-tec.de/pingback.axdhttp://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_0e410a86-4ea4-4169-b7d9-b0769b7bc124http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_0e410a86-4ea4-4169-b7d9-b0769b7bc124#commenthttp://www.infini-tec.de/syndication.axd?post=0e410a86-4ea4-4169-b7d9-b0769b7bc124http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_c7722dbb-2c86-4fd5-9b5f-9d34567282e7gustavo castro on <a href="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_c7722dbb-2c86-4fd5-9b5f-9d34567282e7" alt="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_c7722dbb-2c86-4fd5-9b5f-9d34567282e7">Two-way databinding with ASP.NET struggles with DateTime conversion</a>2009-02-27T14:14:07+00:00gustavo castroObs.:
(even setting the format (Bind(&amp;amp;quot;datafileld&amp;amp;quot;, &amp;amp;quot;{0:dd/MM/yyyy}&amp;amp;quot;) and cultures correctly (ex. Culture=&amp;amp;quot;pt-BR&amp;amp;quot; + uiCulture=&amp;amp;quot;pt-BR&amp;amp;quot; - in WebConfig and overloading InitCulture()), the error happens ...2009-02-27T14:14:07+00:00gustavo castrohttp://www.infini-tec.de/pingback.axdhttp://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_c7722dbb-2c86-4fd5-9b5f-9d34567282e7http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_c7722dbb-2c86-4fd5-9b5f-9d34567282e7#commenthttp://www.infini-tec.de/syndication.axd?post=c7722dbb-2c86-4fd5-9b5f-9d34567282e7http://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_5ba072fa-8437-4aba-b52e-19c3dd58d0fbsiraj on <a href="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_5ba072fa-8437-4aba-b52e-19c3dd58d0fb" alt="/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_5ba072fa-8437-4aba-b52e-19c3dd58d0fb">Two-way databinding with ASP.NET struggles with DateTime conversion</a>2009-04-01T04:05:17+00:00siraji too have the same problem. my windows xp set to english/arabic bilingual. however the first method works well
by using itemupdate event. Infact it is a additional job for programmers but microsoft should work around and
solve it.2009-04-01T04:05:17+00:00sirajhttp://www.infini-tec.de/pingback.axdhttp://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_5ba072fa-8437-4aba-b52e-19c3dd58d0fbhttp://www.infini-tec.de/post/2006/11/29/Two-way-databinding-with-ASPNET-struggles-with-DateTime-conversion.aspx#id_5ba072fa-8437-4aba-b52e-19c3dd58d0fb#commenthttp://www.infini-tec.de/syndication.axd?post=5ba072fa-8437-4aba-b52e-19c3dd58d0fb