文化设置到.aspx的网站 [英] Setting up Culture to Aspx website

查看:142
本文介绍了文化设置到.aspx的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有网站,有一些问题的工作。
其中一个问题是装载5倍。

I have website that has some issue to work with. One of the issues is loading 5x.

我一直在试图设置语言speficic的页面。
我的问题是:

I have been trying to set language speficic for the page. My problem is as follows:

在页面刷新N次它的地方覆盖网页的语言设置。我曾在Application_Start方法中测试修改Global.asax的页面。这种方法被调用一次。
在此之后页面进入Default.aspx页面并点击页面ntimes,当页面被初始化它改变文化为默认文化EN-GB而不是我在Page_Load事件设置之一。

While page is refreshing n times it does somewhere overrides page language settings. I had as test modified global.asax page in Application_Start method. This method gets called only once. After this page goes into default.aspx page and hits the page ntimes, when the page gets initialised it change culture to default culture en-GB instead to the one I have set in Page_Load event.

我已经设置了线程。电流。 UI和文化,以我的具体的文化。但这种简化版,工作。

I have set the thread . current . UI and Culture to my specific culture. But this does't work.

我曾尝试:


  1. 在Global.asax中
  2. 设置语言
  3. 在Global.asax中的onload +页面设置语言为我的Default.aspx

  4. 使用会话设置语言和重新载入网页后在正确的页面显示。

任何想法?

推荐答案

如果您添加到的global.asax.cs它应该工作。它为我工作。

If you add this to Global.asax.cs it should work. It works for me.

protected void Application_BeginRequest(object sender, EventArgs e)
{
    Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("de-ch");
    Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("de-ch");
}

但你的问题的描述是有点混乱......

But your description of the issue is a bit confusing...

这篇关于文化设置到.aspx的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆