2

我有一个多语言网站...
我在 Visual Studio 中为语言(en + 我的语言)制作了两个文件夹,并为每个文件夹制作了我的网站!
对于一个语言网站,我有一个课程可以改变文化和日历以适应我的文化,并在 Global.asax 中调用该课程,如下所示:

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

但是对于多语言网站,我能对那门课做些什么呢?
意思是我应该在哪里为每种语言调用该类?
my pages are base on master and content pages

如你所知global.asax Application_BeginRequest runs First -> after that we have content page_Load -> and at last Master page_Load

4

1 回答 1

1

我认为您必须在 Application_BeginRequest 事件中实现该类......就像这样......

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

}

我建议您通过此链接获取更多信息

我希望它会帮助你..

于 2011-10-23T11:04:24.303 回答