具有经典ASP的AJAX代码在新的IIS 7.5,SQL Server 2008 R2设置中被破坏

时间:2022-01-04 05:38:10

Recently got a new machine to setup and run previously working code with classic ASP, on IIS 7.5 with SQL Server 2008 R2 on a 64-bit Windows 7 Enterprize (local development environment). Local regional settings : American.

最近有一台新机器用于在64位Windows 7 Enterprize(本地开发环境)上使用SQL Server 2008 R2在IIS 7.5上设置和运行以前使用经典ASP的代码。当地区域设置:美国。

Problem: Identical code works on old machine but all the AJAX code is broken on the new machine with the following message

问题:相同的代码适用于旧机器,但所有AJAX代码在新机器上都被破坏,并显示以下消息

An error has occured. (parsererror / SyntaxError: JSON.parse: expected ',' or ']' after array element at line x column xxx of the JSON data)

I can see for a particular page where data should be picked up for a particular colum of JSON response, that picks up wrong colum (could be due to COMMA separation issue(!)). On the pages data is displayed for a particular month of the Year. That is picked up from browser with Request.Form("time") piece of code.

我可以看到一个特定的页面,其中应该为特定的JSON响应列拾取数据,这会拾取错误的列(可能是由于COMMA分离问题(!))。在页面上显示年度特定月份的数据。这是从带有Request.Form(“time”)代码段的浏览器中获取的。

Question: Is it some kind of localization issue? If yes, then where? On the Web server or SQL server. Don't seem to understand where to start finding the issue.

问题:这是某种本地化问题吗?如果是,那么在哪里?在Web服务器或SQL服务器上。似乎不明白从哪里开始发现问题。

Code can be viewed here.

代码可以在这里查看。

1 个解决方案

#1


Apparently it was an IIS setting issue for ASP with LCID attribute that defines how dates, times, and currencies are formatted. Before the fix the web server returned float values with COMMA instead of Decimal point. Actual code has the meta tag CODEPAGE="65001", that is the Windows code page identifier for UTF-8, which didn't match with the encoding is being received. The issue is that the value should match the actual encoding sent.

显然,这是一个带有LCID属性的ASP的IIS设置问题,它定义了日期,时间和货币的格式。在修复之前,Web服务器使用COMMA而不是Decimal点返回浮点值。实际代码具有元标记CODEPAGE =“65001”,即UTF-8的Windows代码页标识符,它与正在接收的编码不匹配。问题是该值应与发送的实际编码匹配。

Possible Fix: Setting Locale ID = 127 on IIS Manager->Site->ASP->Locale ID Solved the problem.

可能的修复:在IIS管理器 - >站点 - > ASP->区域设置ID上设置区域设置ID = 127解决了该问题。

#1


Apparently it was an IIS setting issue for ASP with LCID attribute that defines how dates, times, and currencies are formatted. Before the fix the web server returned float values with COMMA instead of Decimal point. Actual code has the meta tag CODEPAGE="65001", that is the Windows code page identifier for UTF-8, which didn't match with the encoding is being received. The issue is that the value should match the actual encoding sent.

显然,这是一个带有LCID属性的ASP的IIS设置问题,它定义了日期,时间和货币的格式。在修复之前,Web服务器使用COMMA而不是Decimal点返回浮点值。实际代码具有元标记CODEPAGE =“65001”,即UTF-8的Windows代码页标识符,它与正在接收的编码不匹配。问题是该值应与发送的实际编码匹配。

Possible Fix: Setting Locale ID = 127 on IIS Manager->Site->ASP->Locale ID Solved the problem.

可能的修复:在IIS管理器 - >站点 - > ASP->区域设置ID上设置区域设置ID = 127解决了该问题。