Microsoft JScript运行时错误:'Sys'未定义

时间:2022-11-06 16:13:38

I am having problems with an intermitent error in an ASP.Net Ajax enabled website. The error I am receiving is the old faithful "Microsoft JScript runtime error: 'Sys' is undefined" error. Googling this error usually turns up the suggestion to add the correct "httpHandlers" and "httpModules" into the "web.Config" file. The web.config file for this project already has the following lines for those two sections. See below:

我在启用ASP.Net Ajax的网站中遇到了一个间歇性错误。我收到的错误是旧的忠实“Microsoft JScript运行时错误:'Sys'未定义”错误。谷歌搜索此错误通常会提出将“httpHandlers”和“httpModules”添加到“web.Config”文件中的建议。此项目的web.config文件已为这两个部分包含以下行。见下文:

<system.web>
    <httpHandlers>
        <remove path="*.asmx" verb="*"/>
        <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false"/>
        <add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="true"/>
        <add type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*" validate="true"/>
    </httpHandlers>
    <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
</system.web>

The error is intemittent, it sometimes does not present at all when debugging a page, and other times it will present constitently for anything up to a day or so? Please can anyone else suggest another area which may require attention.

错误是无关紧要的,它有时在调试页面时根本不存在,有时它会在一天左右的时间内一直存在?请其他人建议另一个可能需要注意的区域。

BTW, we are using Telerik ajax controls on the page. One of our custom JavaScripts does render before the scriptmanager. ahve tried using both "RadScriptManager1.RegisterClientScriptBlock(...)" and "ClientScript.RegisterClientScriptBlock(...)" but both seem to render the script block above the "Sys.WebForms.PageRequestManager._initialize(...)" line.

顺便说一句,我们在页面上使用Telerik ajax控件。我们的一个自定义JavaScripts在scriptmanager之前进行渲染。 ahve尝试使用“RadScriptManager1.RegisterClientScriptBlock(...)”和“ClientScript.RegisterClientScriptBlock(...)”,但两者似乎都将脚本块呈现在“Sys.WebForms.PageRequestManager._initialize(...)”行之上。

Any help apprecuiated. Thanks in advance, Best regards, Duane.

任何有用的帮助。在此先感谢,祝你好运,Duane。

1 个解决方案

#1


0  

instead of

代替

Sys.WebForms.PageRequestManager._initialize(...)

do

$(document).ready(function(){
    Sys.WebForms.PageRequestManager._initialize(...)
});

(yes, jquery)

(是的,jquery)

#1


0  

instead of

代替

Sys.WebForms.PageRequestManager._initialize(...)

do

$(document).ready(function(){
    Sys.WebForms.PageRequestManager._initialize(...)
});

(yes, jquery)

(是的,jquery)