Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to change Ajax Calendar date picker Date Format Depending on internet explorer language selecton.

Please Help
Thanks in advance..
Posted
Updated 15-Nov-11 0:11am
v2
Comments
dubeyanshul1 15-Nov-11 5:51am    
id.ToString("dd/mm/yyyy");

try this code,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Slacker007 15-Nov-11 6:09am    
Make your comment a solution.

void Application_BeginRequest(Object sender, EventArgs e)
{
System.Globalization.CultureInfo newCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();

newCulture.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy";
newCulture.DateTimeFormat.DateSeparator = "/";

System.Threading.Thread.CurrentThread.CurrentCulture = newCulture;
}

Try this Global.asax page and

web.config page.

<system.web>
<globalization culture="en-US" uiculture="en-US">
 
Share this answer
 
Change the format:

XML
<asp:TextBox runat="server" ID="Date1" autocomplete="off" /><br />
     <ajaxToolkit:CalendarExtender ID="defaultCalendarExtender" runat="server" TargetControlID="Date1" Format="dd/MM/yyyy"  />
 
Share this answer
 
http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.enablescriptglobalization.aspx[^]


set the EnableScriptGlobalization property so that client script can display a culture-specific date and time in the browser.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900