asp.net mvc的在哪里设置默认的文化? [英] asp.net mvc where to set default culture?

查看:92
本文介绍了asp.net mvc的在哪里设置默认的文化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于多语言asp.net的MVC网站。

我应该在哪里设置线程的文化默认语言(这是TR-TR我的情况),除我需要它保存在cookie的,如果它不存在了。在的Application_Start()或别的?

我有多个站点(域),所以我需要更改默认语言的网站具体。

  example.com必须设置默认文化TR-TR
 example2.com必须默认设置文化为en-US


解决方案

试试看在web.config中设定

 <结构>
    <&的System.Web GT;
        <全球化的UICulture =EN-GB文化=EN-GB/>
    < /system.web>
< /结构>

这是设置文化更通用的方法...

For multilingual asp.net mvc web site.

Where should i set thread's culture to default language (which is tr-TR for my case), in addition i need to save this in cookie if it does not exists. in Application_Start() or else ?

I have multiple sites(domains), so i need to change default language site specific.

 example.com must set default culture to tr-TR
 example2.com must set default culture to en-US

解决方案

Try it setting in web.config

<configuration>
    <system.web>
        <globalization uiCulture="en-GB" culture="en-GB" />
    </system.web>
</configuration>

this is a more generic way to set the culture...

这篇关于asp.net mvc的在哪里设置默认的文化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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