tags:

views:

377

answers:

3

Hi All,

I am using ajaxToolkit:CalendarExtender in my multi lingual project. The problem with this calender is that it localizes the month strings in the control but doesn't localize the Today string and i need to localize this text also.

Please anyone help me out in this problem.

A: 

Hi,

Try this

protected void CalendarExtender1_Load(object sender, EventArgs e)
    {

        CalendarExtender1.TodaysDateFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
        // or
        //CalendarExtender1.TodaysDateFormat = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;

    }
Sandy
i am usung ajaxToolkit:CalendarExtender, i don't have TodaysDateFormat property in this control.
Praveen
which version of toolkit are you using? code which i have done is using version 3.0.30930.0
Sandy
thanks dotnetexperiments for help , actually i want to localize the text "Today" in the calender control not the format....Do you have any idea about that?
Praveen
+1  A: 

Try changing the ScriptManager.EnableScriptGlobalization property to True. It should work as long as you are setting the desired cutlture value.

    protected void Page_Load(object sender, EventArgs e)
{
    string Lang = “es-MX”;//set your culture here
    System.Threading.Thread.CurrentThread.CurrentCulture =
        new System.Globalization.CultureInfo(Lang);
}
Ricardo
A: 

praveen,

I am unable to localize months and days .today is getting localized .

Please tell me how u did that

My environment is Sharepoint with webpart which containa ajax calender extender

ram

related questions