what event(place) should i use for change culture and calendar in mulilanguage web site?

StackOverflow https://stackoverflow.com/questions/7865691

سؤال

i have a multi language web site...
i made two folders in visual studio for languages(en + my language)and made my web site for each one!
for one language web site i had a class for changing culture and calendar to my culture and callled that class in Global.asax like below :

protected void Application_BeginRequest(object sender, EventArgs e)
{
    myLanCultureAndCalendar.SetCultureAndCalendar();
}

but for multi language web site what can i do about that class ?
mean where should i call that class for each languages?
my pages are base on master and content pages

as you know global.asax Application_BeginRequest runs First -> after that we have content page_Load -> and at last Master page_Load

هل كانت مفيدة؟

المحلول

I think you have to implement that class in Application_BeginRequest event ...like this..

protected void Application_BeginRequest(Object sender, EventArgs e)
{
    String language = Request.UserLanguages[0];
    if (language.Length > 1) language = language.Substring(0, 2);
    .......
    ........

}

I suggest you pls go through this link for more info

I hope it will helps you..

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top