我使用微軟的Ajax工具包CalendarExtender
控制,下拉式日曆功能添加到常規的文本框:如何覆蓋AjaxToolkit CalendarExtender日期到字符串轉換?
<asp:TextBox ID="edStartDate" runat="server" />
<asp:CalendarExtender ID="CalendarExtender1" runat="server"
TargetControlID="edStartDate" />
這對於大多數客戶的語言環境正常工作。看來控制器執行服務器請求以將DateTime
轉換爲本地化的String
。
例如,今天(2012年10月1日)在阿拉伯語15/11/33
顯示細膩:
而且還下索布顯示細膩1. 10. 2012
:
但是some locales do not display properly in .NET1////10////2012
:
在這種情況下,我需要某種OnFormatDate
事件,我可以提供一個日期的正確定位爲一個字符串。這導致我的問題:
如何重寫AjaxToolkit CalendarExtender日期到字符串轉換?
注:不要混淆的例子的問題。
- 我要問如何定製一個日期轉換爲字符串在
CalendarExtender
- 即使我不處理在.NET中的一個錯誤,它不會改變我的問題
- 即使我不處理一個
CalendarExtender
,我還在問這個問題
該頁面已經在使用客戶端瀏覽器的語言環境(因此不需要爲de-DE用戶硬編碼es-MX)。 –