I'm trying to set up a web site using Dynamic Data and I'm facing with a run-time error caused, in my opinion, by the different local format of a date. My system is a Windows 7 in english but the current time and date are in the italian format, so the date
is displayed in the dd/MM/yyyy.
My dynamic web site displays correctly the dates and numbers according to system settings but if I try to click on a link dynamically generated that includes a date in the URL query string a System.FormatException is thrown. I guess that the problem occurs
because the date in the query string is in the en-US format and could not be automatically converted into a DateTime.
In my case the query string is: Details.aspx?EmployeeID=1&DepartmentID=7&ShiftID=1&StartDate=07/31/1996 00:00:00
In the January issue of MSDN Magazine I found the article "Build a Data-Driven Enterprise Web Site in 5 Minutes" where is esplained how to use the ASP.Net Dynamic Web Site. I tried and it works very well :)
Then, exploring the generated pages, in the page that shows the contents of the table EmployeeDepartmentsHistory of the AdventureWorks SQL Server sample Database, I found the problem!
The the date July 31, 2006 in the StartDate field is rendered correctly (according to my system settings) as 31/07/2006 but the href on the link that shows the record detail reports:
....
<a href="/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=1&DepartmentID=7&ShiftID=1&StartDate=07%2F31%2F1996%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl02$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/EmployeeDepartmentHistory/Details.aspx?EmployeeID=1&DepartmentID=7&ShiftID=1&StartDate=07%2F31%2F1996%2000%3A00%3A00">Details</a>
....
<div>As you can see the value of the StartDate param is in the format 07/31/1996, if I click on that link the following exception is thrown:</div>
<div></div>
<div>
Hi Antonello, is this from the list page in the grid, I am trying to work out where the link is generated? I don't know of anywhere this sirt of link is generated other than the Insert Link?
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Hi Antonello, it looks to me like this is a composite primary key is that the case? if so I think you will need to look at the Children.ascx or ForeignKey.ascx field templates and maybe do some fixing there.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
antonello
Member
8 Points
5 Posts
Problem with DateTime locale format
Mar 05, 2011 08:54 PM|LINK
I'm trying to set up a web site using Dynamic Data and I'm facing with a run-time error caused, in my opinion, by the different local format of a date. My system is a Windows 7 in english but the current time and date are in the italian format, so the date is displayed in the dd/MM/yyyy.
My dynamic web site displays correctly the dates and numbers according to system settings but if I try to click on a link dynamically generated that includes a date in the URL query string a System.FormatException is thrown. I guess that the problem occurs because the date in the query string is in the en-US format and could not be automatically converted into a DateTime.
In my case the query string is: Details.aspx?EmployeeID=1&DepartmentID=7&ShiftID=1&StartDate=07/31/1996 00:00:00
Is there any solution?
Thanks in advance.
Bye.
whighfield
Star
11721 Points
1859 Posts
Re: Problem with DateTime locale format
Mar 05, 2011 10:18 PM|LINK
In this case convert your date to a generic format "yyyy-MM-dd" or date and time "yyyy-MM-dd HH:mm:ss"
DateTime dt = DateTime.Now; string dtString = dt.ToString("yyyy-MM-dd HH:mm:ss");Blog | I need more space:DropBox Referral
antonello
Member
8 Points
5 Posts
Re: Problem with DateTime locale format
Mar 07, 2011 11:41 AM|LINK
Thanks for your reply, but links in the ASP.NET Dynamics web pages are generated automatically, where should I place this conversion?
sjnaughton
All-Star
27391 Points
5485 Posts
MVP
Re: Problem with DateTime locale format
Mar 09, 2011 08:10 AM|LINK
Hi Antonello, where is this link List, Details page?
DynamicData
Always seeking an elegant solution.
antonello
Member
8 Points
5 Posts
Re: Problem with DateTime locale format
Mar 09, 2011 08:41 PM|LINK
Hi sjnaughton,
I'll try to explain better the problem.
In the January issue of MSDN Magazine I found the article "Build a Data-Driven Enterprise Web Site in 5 Minutes" where is esplained how to use the ASP.Net Dynamic Web Site. I tried and it works very well :)
Then, exploring the generated pages, in the page that shows the contents of the table EmployeeDepartmentsHistory of the AdventureWorks SQL Server sample Database, I found the problem!
The the date July 31, 2006 in the StartDate field is rendered correctly (according to my system settings) as 31/07/2006 but the href on the link that shows the record detail reports:
<div>As you can see the value of the StartDate param is in the format 07/31/1996, if I click on that link the following exception is thrown:</div> <div></div> <div> </div> <div></div> <div>Hoping it could help.</div> <div>Bye.</div>DynamicData
sjnaughton
All-Star
27391 Points
5485 Posts
MVP
Re: Problem with DateTime locale format
Mar 10, 2011 01:42 PM|LINK
Hi Antonello, is this from the list page in the grid, I am trying to work out where the link is generated? I don't know of anywhere this sirt of link is generated other than the Insert Link?
Always seeking an elegant solution.
antonello
Member
8 Points
5 Posts
Re: Problem with DateTime locale format
Mar 10, 2011 11:22 PM|LINK
Hello again Steve,
yes!Please excuse me I did not paste the entire html, but I know could be helpful and more clear. Tell me if you need it.
Bye.
sjnaughton
All-Star
27391 Points
5485 Posts
MVP
Re: Problem with DateTime locale format
Mar 11, 2011 10:03 AM|LINK
yes the HTML would be usefull, what I can't understand is why it is adding a date to the URL is the date a part of the PK?
Always seeking an elegant solution.
antonello
Member
8 Points
5 Posts
Re: Problem with DateTime locale format
Mar 13, 2011 06:32 PM|LINK
Ok.
I removed only the content of the hidden field __VIEWSTATE and the options loaded in the list boxes.
Thank you,
Bye.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="it" xmlns="http://www.w3.org/1999/xhtml"> <head><title> Employee departments history </title><link href="../Site.css" rel="stylesheet" type="text/css" /> </head> <body> <h1 class="DDMainHeader">Dynamic Data Site</h1> <div class="DDNavigation"> <a href="../"><img src="../DynamicData/Content/Images/back.gif" alt="Back to home page" />Back to home page</a> </div> <form method="post" action="List.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1"> <div class="aspNetHidden"> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" /> </div> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> <script src="/AdventureWorks/WebResource.axd?d=oyReLhZjPDOfzR05BGoWK72mtCghACLxWGlydx6u0wl5auQp_w7jmGh-Vz0Bg5xpkzuEQFn0vGssElPIrb7GTgrH8gn1cq6SQlBZhXlRZd01&t=634353074494680640" type="text/javascript"></script> <script src="/AdventureWorks/WebResource.axd?d=L3hGqdz0kUNHn19pVzAS4V6rd45eYkM6cgWMafk2szSmDFneLfr7wwsm7KRlVuDelR9C4TcrX0-qYO_gOXwd5SWQ2hZD4_RjSPQlgdfHHgw1&t=634353074494680640" type="text/javascript"></script> <script src="/AdventureWorks/ScriptResource.axd?d=F3Wk0D3EOnAOwMzjo3GYeSFx-2YFHpSV58pMWn-YgAn80G6K50zOVHHpIRdHOohiSKhb0va3AjMeh2QPZs-7MtOoOWKclfySe5Hy6AlSEYVSYIBvV2srC3x4n03n038m7KzHVePEZDdqxx-pGQDh3AX8_a2GkaYNKzP34dicPHji1GXOu6-3-Xx6aw18ElK50&t=ffffffffa5d4ef3e" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.'); function WebForm_OnSubmit() { if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false; return true; } //]]> </script> <div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" /> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="zFCKIY1o73PdrITUEaEgYXQcn8SPCuG1kYjaLCZheBPzIrX0d8Ow4lN+Ua0fr3q95mGjw9mvrR3xClmjLGQNoqx5uPGuB5JAeAbXuzxfvgn0n19SadQAOMYwVEh/qBJhH9t3q6Rep2/Ay2VQvb34XSutNGLrPVFeHm91jzEfa/xDPYjnqLAGmoclOGgplUCltXiFRHWNmUXqWQDE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0H8kWGTmXFjbKQOf/Oo1dKLGYlVJjP+o6FkeeGkbB5E/iZFhFPrzy2dD71B4dwJwDvnMFxi2l+GC4P0uNrB6v2gxTkaz8ZNGCIqrZJL2PaKfIhnxsxMcv4ej6bbup+/YecS3h9r/75LzjL5Xyq/YLEOek5HukpCojkdq61XbR3retJRJ+mvwe+MnlGRWjod5DCSAJxF7B9+hDWU8BT4XRHlN3rMTZvvBwpKDHwcP3ARv/an2zmsmoJPH78CAVuhQKLCoDIVUXT5nspJm1VIUF5S/x/BH3tcv75OiMj4ej1dkBBDP8beJFBGIQ9XO1AlUrTAM7QDPcIiEkz4GjVYafS4USFcLHuoosebxZPQ0MipoM1MefEFNLb6AT+N2KjCgb6xxL21Z+uu+lLE49ayfstyZk5H3XncmnyBG9t2D9sLMkVxc4w4wANraPjzPSKW+d91" /> </div> <div> <h2 class="DDSubHeader">Employee departments history</h2> <div id="ContentPlaceHolder1_UpdatePanel1"> <div class="DD"> <div id="ContentPlaceHolder1_ValidationSummary1" class="DDValidator" style="display:none;"> </div> <span id="ContentPlaceHolder1_GridViewValidator" class="DDValidator" style="display:none;"></span> <label for="ContentPlaceHolder1_ctl01_0_DropDownList1_0">Department</label> <select name="ctl00$ContentPlaceHolder1$ctl02$ctl01$DropDownList1" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$ctl02$ctl01$DropDownList1\',\'\')', 0)" id="ContentPlaceHolder1_ctl01_0_DropDownList1_0" class="DDFilter"> <option selected="selected" value="">All</option> </select> <br /> <label for="ContentPlaceHolder1_ctl01_1_DropDownList1_1">Employee</label> <select name="ctl00$ContentPlaceHolder1$ctl03$ctl01$DropDownList1" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$ctl03$ctl01$DropDownList1\',\'\')', 0)" id="ContentPlaceHolder1_ctl01_1_DropDownList1_1" class="DDFilter"> <option selected="selected" value="">All</option> <option value="1">adventure-works\guy1</option> </select> <br /> <label for="ContentPlaceHolder1_ctl01_2_DropDownList1_2">Shift</label> <select name="ctl00$ContentPlaceHolder1$ctl04$ctl01$DropDownList1" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$ctl04$ctl01$DropDownList1\',\'\')', 0)" id="ContentPlaceHolder1_ctl01_2_DropDownList1_2" class="DDFilter"> <option selected="selected" value="">All</option> <option value="1">Day</option> <option value="2">Evening</option> <option value="3">Night</option> </select> <br /> <br /> </div> <div> <table class="DDGridView" cellspacing="0" cellpadding="6" rules="all" border="1" id="ContentPlaceHolder1_GridView1" style="border-collapse:collapse;"> <tr class="th"> <th scope="col"> </th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$StartDate')">StartDate</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$EndDate')">EndDate</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$ModifiedDate')">ModifiedDate</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$it.Department.Name')">Department</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$it.Employee.LoginID')">Employee</a></th><th scope="col"><a href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1','Sort$it.Shift.Name')">Shift</a></th> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=1&DepartmentID=7&ShiftID=1&StartDate=07%2F31%2F1996%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl02$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=1&DepartmentID=7&ShiftID=1&StartDate=07%2F31%2F1996%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">31/07/1996 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">30/07/1996 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_0_HyperLink1_0" href="/AdventureWorks/Department/Details.aspx?DepartmentID=7">Production</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_0_HyperLink1_0" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=1">adventure-works\guy1</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_0_HyperLink1_0" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=2&DepartmentID=4&ShiftID=1&StartDate=02%2F26%2F1997%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl03$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=2&DepartmentID=4&ShiftID=1&StartDate=02%2F26%2F1997%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">26/02/1997 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">25/02/1997 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_1_HyperLink1_1" href="/AdventureWorks/Department/Details.aspx?DepartmentID=4">Marketing</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_1_HyperLink1_1" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=2">adventure-works\kevin0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_1_HyperLink1_1" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=3&DepartmentID=1&ShiftID=1&StartDate=12%2F12%2F1997%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl04$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=3&DepartmentID=1&ShiftID=1&StartDate=12%2F12%2F1997%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">12/12/1997 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">11/12/1997 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_2_HyperLink1_2" href="/AdventureWorks/Department/Details.aspx?DepartmentID=1">Engineering</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_2_HyperLink1_2" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=3">adventure-works\roberto0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_2_HyperLink1_2" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=4&DepartmentID=1&ShiftID=1&StartDate=01%2F05%2F1998%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl05$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=4&DepartmentID=1&ShiftID=1&StartDate=01%2F05%2F1998%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">05/01/1998 00:00:00 </td><td style="white-space:nowrap;">30/06/2000 00:00:00 </td><td style="white-space:nowrap;">28/06/2000 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_3_HyperLink1_3" href="/AdventureWorks/Department/Details.aspx?DepartmentID=1">Engineering</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_3_HyperLink1_3" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=4">adventure-works\rob0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_3_HyperLink1_3" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=4&DepartmentID=2&ShiftID=1&StartDate=07%2F01%2F2000%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl06$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=4&DepartmentID=2&ShiftID=1&StartDate=07%2F01%2F2000%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">01/07/2000 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">30/06/2000 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_4_HyperLink1_4" href="/AdventureWorks/Department/Details.aspx?DepartmentID=2">Tool Design</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_4_HyperLink1_4" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=4">adventure-works\rob0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_4_HyperLink1_4" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=5&DepartmentID=2&ShiftID=1&StartDate=01%2F11%2F1998%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl07$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=5&DepartmentID=2&ShiftID=1&StartDate=01%2F11%2F1998%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">11/01/1998 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">10/01/1998 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_5_HyperLink1_5" href="/AdventureWorks/Department/Details.aspx?DepartmentID=2">Tool Design</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_5_HyperLink1_5" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=5">adventure-works\thierry0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_5_HyperLink1_5" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=6&DepartmentID=4&ShiftID=1&StartDate=08%2F16%2F1999%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl08$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=6&DepartmentID=4&ShiftID=1&StartDate=08%2F16%2F1999%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">16/08/1999 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">15/08/1999 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_6_HyperLink1_6" href="/AdventureWorks/Department/Details.aspx?DepartmentID=4">Marketing</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_6_HyperLink1_6" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=6">adventure-works\david0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_6_HyperLink1_6" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=6&DepartmentID=5&ShiftID=1&StartDate=01%2F20%2F1998%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl09$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=6&DepartmentID=5&ShiftID=1&StartDate=01%2F20%2F1998%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">20/01/1998 00:00:00 </td><td style="white-space:nowrap;">15/08/1999 00:00:00 </td><td style="white-space:nowrap;">13/08/1999 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_7_HyperLink1_7" href="/AdventureWorks/Department/Details.aspx?DepartmentID=5">Purchasing</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_7_HyperLink1_7" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=6">adventure-works\david0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_7_HyperLink1_7" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=7&DepartmentID=7&ShiftID=3&StartDate=01%2F26%2F1998%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl10$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=7&DepartmentID=7&ShiftID=3&StartDate=01%2F26%2F1998%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">26/01/1998 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">25/01/1998 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_8_HyperLink1_8" href="/AdventureWorks/Department/Details.aspx?DepartmentID=7">Production</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_8_HyperLink1_8" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=7">adventure-works\jolynn0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_8_HyperLink1_8" href="/AdventureWorks/Shift/Details.aspx?ShiftID=3">Night</a> </td> </tr><tr class="td"> <td> <a href="/AdventureWorks/EmployeeDepartmentHistory/Edit.aspx?EmployeeID=8&DepartmentID=7&ShiftID=1&StartDate=02%2F06%2F1998%2000%3A00%3A00">Edit</a> <a onclick="return confirm("Are you sure you want to delete this item?");" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl11$ctl01", "", true, "", "", false, true))">Delete</a> <a href="/AdventureWorks/EmployeeDepartmentHistory/Details.aspx?EmployeeID=8&DepartmentID=7&ShiftID=1&StartDate=02%2F06%2F1998%2000%3A00%3A00">Details</a> </td><td style="white-space:nowrap;">06/02/1998 00:00:00 </td><td style="white-space:nowrap;"> </td><td style="white-space:nowrap;">05/02/1998 00:00:00 </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Department_9_HyperLink1_9" href="/AdventureWorks/Department/Details.aspx?DepartmentID=7">Production</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Employee_9_HyperLink1_9" href="/AdventureWorks/Employee/Details.aspx?EmployeeID=8">adventure-works\ruth0</a> </td><td style="white-space:nowrap;"><a id="ContentPlaceHolder1_GridView1___Shift_9_HyperLink1_9" href="/AdventureWorks/Shift/Details.aspx?ShiftID=1">Day</a> </td> </tr><tr class="DDFooter"> <td colspan="7"> <div class="DDPager"> <span class="DDFloatLeft"> <input type="image" name="ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonFirst" id="ContentPlaceHolder1_GridView1_ctl00_ImageButtonFirst" title="First page" src="../DynamicData/Content/Images/PgFirst.gif" alt="First page" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonFirst", "", true, "", "", false, false))" style="height:9px;width:8px;" /> <input type="image" name="ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonPrev" id="ContentPlaceHolder1_GridView1_ctl00_ImageButtonPrev" title="Previous page" src="../DynamicData/Content/Images/PgPrev.gif" alt="Previous page" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonPrev", "", true, "", "", false, false))" style="height:9px;width:5px;" /> <label for="ContentPlaceHolder1_GridView1_ctl00_TextBoxPage" id="ContentPlaceHolder1_GridView1_ctl00_LabelPage">Page </label> <input name="ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$TextBoxPage" type="text" value="1" size="5" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$TextBoxPage\',\'\')', 0)" onkeypress="if (WebForm_TextBoxKeyHandler(event) == false) return false;" id="ContentPlaceHolder1_GridView1_ctl00_TextBoxPage" class="DDControl" style="width:20px;" /> of <span id="ContentPlaceHolder1_GridView1_ctl00_LabelNumberOfPages">30</span> <input type="image" name="ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonNext" id="ContentPlaceHolder1_GridView1_ctl00_ImageButtonNext" title="Next page" src="../DynamicData/Content/Images/PgNext.gif" alt="Next page" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonNext", "", true, "", "", false, false))" style="height:9px;width:5px;" /> <input type="image" name="ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonLast" id="ContentPlaceHolder1_GridView1_ctl00_ImageButtonLast" title="Last page" src="../DynamicData/Content/Images/PgLast.gif" alt="Last page" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$ImageButtonLast", "", true, "", "", false, false))" style="height:9px;width:8px;" /> </span> <span class="DDFloatRight"> <label for="ContentPlaceHolder1_GridView1_ctl00_DropDownListPageSize" id="ContentPlaceHolder1_GridView1_ctl00_LabelRows">Results per page:</label> <select name="ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$DropDownListPageSize" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridView1$ctl13$ctl00$DropDownListPageSize\',\'\')', 0)" id="ContentPlaceHolder1_GridView1_ctl00_DropDownListPageSize" class="DDControl"> <option value="5">5</option> <option selected="selected" value="10">10</option> <option value="15">15</option> <option value="20">20</option> </select> </span> </div> </td> </tr> </table> </div> <br /> <div class="DDBottomHyperLink"> <a id="ContentPlaceHolder1_InsertHyperLink" href="/AdventureWorks/EmployeeDepartmentHistory/Insert.aspx"><img src="../DynamicData/Content/Images/plus.gif" alt="Insert new item" />Insert new item</a> </div> </div> </div> <script type="text/javascript"> //<![CDATA[ var Page_ValidationSummaries = new Array(document.getElementById("ContentPlaceHolder1_ValidationSummary1")); var Page_Validators = new Array(document.getElementById("ContentPlaceHolder1_GridViewValidator")); //]]> </script> <script type="text/javascript"> //<![CDATA[ var ContentPlaceHolder1_ValidationSummary1 = document.all ? document.all["ContentPlaceHolder1_ValidationSummary1"] : document.getElementById("ContentPlaceHolder1_ValidationSummary1"); ContentPlaceHolder1_ValidationSummary1.headertext = "List of validation errors"; var ContentPlaceHolder1_GridViewValidator = document.all ? document.all["ContentPlaceHolder1_GridViewValidator"] : document.getElementById("ContentPlaceHolder1_GridViewValidator"); ContentPlaceHolder1_GridViewValidator.controltovalidate = "ContentPlaceHolder1_GridView1"; ContentPlaceHolder1_GridViewValidator.display = "None"; //]]> </script> <script type="text/javascript"> //<![CDATA[ var Page_ValidationActive = false; if (typeof(ValidatorOnLoad) == "function") { ValidatorOnLoad(); } function ValidatorOnSubmit() { if (Page_ValidationActive) { return ValidatorCommonOnSubmit(); } else { return true; } } //]]> </script> </form> </body> </html>sjnaughton
All-Star
27391 Points
5485 Posts
MVP
Re: Problem with DateTime locale format
Mar 17, 2011 04:29 PM|LINK
Hi Antonello, it looks to me like this is a composite primary key is that the case? if so I think you will need to look at the Children.ascx or ForeignKey.ascx field templates and maybe do some fixing there.
Always seeking an elegant solution.