Ajax calendar - how to change language?

  • Thread starter Thread starter staeri
  • Start date Start date
S

staeri

I have the standard Ajax calendar, like this:

<cc1:calendarextender targetcontrolid="txtOrderDate" format="yyyy-MM-
dd" runat="server"></cc1:calendarextender>

<asp:TextBox ID="txtOrderDate" Text='<%# Bind("OrderDate") %>'
runat="server" CssClass="textGrey11"></asp:TextBox>

1. How can I change the language to Swedish in the calendar?
2. After postback the date in txtOrderdate is shown as: 2008-01-19
00:00, I just want to show 2008-01-19. How can that be done?

Very grateful for help!

// S
 
Hi there,



<%@ Page Language="C#" Culture="sv-SE" AutoEventWireup="true"
CodeFile="Default4.aspx.cs"
Inherits="Default4" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager runat="server" ID="manager"
EnableScriptLocalization="true" EnableScriptGlobalization="true" />
<asp:TextBox ID="txtOrderDate" runat="server" />
<cc1:CalendarExtender ID="ce" runat="server" Enabled="True"
TargetControlID="txtOrderDate"
OnClientDateSelectionChanged="function(sender, e) { sender.hide(); }"
Format="yyyy-MM-dd">
</cc1:CalendarExtender>
</div>
</form>
</body>
</html>

Note following attributes:

- <%@ Page %> directive: Culture="sv-SE"
- ScripManager: EnableScriptLocalization="true"
EnableScriptGlobalization="true"
- CalendarExtender : Format="yyyy-MM-dd"

Hope it helps
 
Thank you very much for the help!

The language was changed in the calender, except for "Today" at the
bottom of the calendar. How can that also be changed?

After postback the date in txtOrderdate is still shown as: 2008-01-19
00:00, I just want to show 2008-01-19. How can that be done?

Best regards,

S
 
What version of AjaxControlToolkit are you using? Make sure you've updated to
the latest release. "Today" problem may be related to lack of satelite
assebly with Swedish language.
 
Back
Top