ASP.net 区域性问题语言选项 (win2k3)
我有一个 Asp.net 表单的文本框。有一个简单的 javascript 可以分隔 TextBox 中的每三个数字。当您在文本框中输入数据时,它工作正常。我使用逗号 ,
来分隔数字,并使用点 .
作为浮点字符。
正如我所说,当我在文本框中输入数据时,一切正常。但是当发生回发并且保存的数据返回到客户端时,每个 .
(s) 都已被删除(例如 2.3
保存为 23< /code> 和 TextBox 中的数字由
.
分隔,而不是 ,
。
此问题仅发生在特定服务器(windows server 2003 sp1)中并且工作正常在其他 Windows Server 2003 中(SP1)!我第一次遇到这个问题!
但我认为问题是因为当我将区域和语言选项更改为该服务器时。设置:
小数符号 -> .
数字分组符号 -> ,
没有任何变化。
当我检查时 自定义设置后的以下项目:
全部应用当前用户帐户和默认用户配置文件的设置 ->检查
当我重新启动服务器时,它会从域中跳出,需要重新加入域控制器!当然,一切都不再改变!
你有这个问题吗?请任何解决方案!
我无法在这里发布代码,因为代码太复杂,我确信问题不是因为代码,因为除非指定的服务器,否则它在任何地方都可以工作。
编辑
还为网络服务用户设置区域和语言选项可能有助于解决问题。有人知道我该怎么做吗?
I have a TextBox in an Asp.net form. there is a simple javascript witch separates each three digits in TextBox. it works fine when you enter data in TextBox. I used coma ,
for separating digits and used dot .
as floating point character.
as I said every thing works fine when I am entering data in TextBox. but when the post-back occurs and saved data returns to client, every .
(s) has been removed (for example 2.3
saved as 23
and digits in TextBox are separated by .
instead of ,
.
this problem occurs just in a specific server (windows server 2003 sp1) and works fine in other windows server 2003 (SP1)! I am experiencing this problem for first time!
But I think the problem is because of specific Regional & Language Options in the server. This server is joined to a domain controller. when I change the regional and language options to this set:
Decimal Symbol -> .
Digit Grouping Symbol -> ,
nothing changes.
when I check the following item after customizing settings :
Apply All Settings to the current user account and to the default user profile -> checked
when I restart the Server, It jumps out from domain and need to be re-joined to domain controller! and of-course nothing changes again!
Do you had this problem? any solution please!
I can not post code here, because the code is too complex and I am sure problem is not because of code because it is working every where unless the specified server.
EDIT
Also setting regional and language options for network service user may help to solve the problem. any body knows how can I do this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过在 web.config 中使用全球化标签?这可以防止您在多个服务器配置不同(即不同的语言包)时遇到麻烦。
Have you tried using the globalization tag in your web.config? This prevents you from running into trouble when multiple servers are configured differently (ie. different languagepacks).
在解决类似的问题很长时间后,我在一些线索的帮助下做了以下工作(顺便说一句,StackOverFlow 也发现了,StackOverFlow 很摇滚......)
我做的第一件事就是转储服务器的内容实际上的想法(Page_Load):
同样在Windows 2003上,我尝试通过常规控制面板修复区域设置,但没有成功。
我还尝试在 web.config 中设置全球化设置,如其他解决方案中所述,但效果甚微。
似乎一旦你开始搞乱区域设置,你很快就会陷入混乱的地步。我决定避免弄乱注册表并寻求代码解决方案,因为这样我就不必担心我的代码何时发布到生产环境。
我将以下代码添加到我的页面的基类中,以便它可以在任何地方修复它。您也可以将其放在 Page_Load 中。
问题解决了。无论如何对我来说。
After goofing around with a similar problem for WAY to long I did the following with the help of a number of clues (also found on StackOverFlow, StackOverFlow rocks by the way...)
The first thing I did was dump out what the server was actually thinking (Page_Load):
Also on Windows 2003, I tried fixing the regional setting via the regular control panel but with no success.
I also tried setting the globalization settings in the web.config as mentioned in the other solution but with little effect.
It seems that once you start messing with the regional setting you can quickly get to the point where things are messed up. I decided to avoid messing with the registry and go for a code solution because then I would not have to worry when my code was released to production.
I added the following code to the base class for my page so that it would fix it everywhere. You could also place it in the Page_Load.
Problem solved. For me anyway.