本文介绍了在IIS7中设置不同的区域性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的申请遇到不同的文化问题.例如,我已经在IIS7中配置了我的应用程序,并在浏览器中设置了语言提示.在服务器中运行应用程序时,将设置中国文化.我将在本地浏览器中更改德语的语言.我将在本地浏览器中看到没有应用区域性的应用程序.

如何在IIS7中设置不同的文化?

在此先感谢

Rameshkumar.T

Hi,
I have face different culture problem in my application. For example, I have configured my application in IIS7 and set the language chines in browser. The chines culture is set When run the application in server. I will go to change language german in my local browser. I will see my application in local browser which culture is not applied.

how to set different culture in IIS7?

Thanks in advance

Rameshkumar.T

推荐答案

<globalization enableClientBasedCulture="true" culture="de-DE" uiCulture="auto"/>



1. culture = de-DE将设置数据库获取记录的语言,例如:如果数据库为"de-DE"语言,则文化应为de-DE.
2. uiCulture = auto将考虑在客户端浏览器中为用户界面设置的语言.



1. culture=de-DE will set the language in which the Database will fetch the records, for e.g: if Database is of "de-DE" language then culture should be in de-DE.
2. uiCulture=auto will consider the language set in Clients browser for User Interface.

protected void Page_Init(object sender, EventArgs e)
{
    System.Globalization.CultureInfo pageCultureInfo = System.Globalization.CultureInfo.CurrentCulture;
    Page.Culture = pageCultureInfo.Name.ToString();
}


新代码:[当前浏览器的区域性将设置为页面UICulture]


New Code: [Current Browser Culture will be set to Page UICulture]

protected void Page_Init(object sender, EventArgs e)
{
    System.Globalization.CultureInfo pageCultureInfo = new CultureInfo(ApplicationConstants.RegionalSettings, false);
    Page.UICulture = pageCultureInfo.Name.ToString();
}



解决方案状态:
类中的属性数据类型将与表"字段的数据类型相同.
1.对于价格和权重字段
a)如果属性的数据类型为字符串,则格式会完美应用
b)如果属性的数据类型是双精度格式,则存在问题
数据库中的drOrder [''Purchase_Price'']值设置为1,50
double dblPrice = Convert.ToDouble(drOrder [''Purchase_Price''])
dblPrice显示1.50
dblPrice.ToString()显示1,50
绑定到coolite网格时,它显示1.50而不是1,50
已在论坛上查看http://msdn.microsoft.com/zh-cn/library/system.convert.todouble(VS.71).aspx



Solution Status:
The Property Data type of in Class will be same as the Table field Data type
1. For Price and Weight fields
a)If data type of property is string the format is applied perfectly
b) If data type of property is double the formatting has problem
drOrder[''Purchase_Price''] value is set to 1,50 in database
double dblPrice = Convert.ToDouble(drOrder[''Purchase_Price''])
dblPrice shows 1.50
dblPrice.ToString() shows 1,50
when binding to coolite grid it displays 1.50 instead of 1,50
checked with forums http://msdn.microsoft.com/en-us/library/system.convert.todouble(VS.71).aspx


这篇关于在IIS7中设置不同的区域性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 07:50