刚刚调试ajax的扩展控件,总是提示“sys”未定义错误。
百度结果如下:
百度结果如下:
由于重新安装了Ajax v1.0.61025版本后,程序中总是出现:错误:'sys'未定义的信息.
最后找到了问题的所在. 以下是我的解决方法,仅供参考。
首先Web.Config 中配置成:
.
.............
< httpHandlers >
< remove verb ="*" path ="*.asmx" />
<!--
<addverb="*"path="*.asmx"validate="false"type="Microsoft.Web.Script.Services.
ScriptHandlerFactory,Microsoft.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<addverb="GET"path="ScriptResource.axd"type="Microsoft.Web.Handlers.
ScriptResourceHandler"validate="false"/>
-->
<!-- 把上面的改为如下,1.0rc版,已经把命名空间改为了system -->
< add verb ="*" path ="*.asmx" validate ="false" type ="System.Web.Script.Services.
ScriptHandlerFactory,System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
< add verb ="GET" path ="ScriptResource.axd" type ="System.Web.Handlers.
ScriptResourceHandler" validate ="false" />
</ httpHandlers >
< compilation debug ="true" >
< assemblies >
<!--
<addassembly="Microsoft.Web.Extensions,Version=1.0.61025.0,
Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
改为如下
-->
< add assembly ="System.Web.Extensions,Version=1.0.61025.0,
Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
</ assemblies >
</ compilation >
............
< httpHandlers >
< remove verb ="*" path ="*.asmx" />
<!--
<addverb="*"path="*.asmx"validate="false"type="Microsoft.Web.Script.Services.
ScriptHandlerFactory,Microsoft.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<addverb="GET"path="ScriptResource.axd"type="Microsoft.Web.Handlers.
ScriptResourceHandler"validate="false"/>
-->
<!-- 把上面的改为如下,1.0rc版,已经把命名空间改为了system -->
< add verb ="*" path ="*.asmx" validate ="false" type ="System.Web.Script.Services.
ScriptHandlerFactory,System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
< add verb ="GET" path ="ScriptResource.axd" type ="System.Web.Handlers.
ScriptResourceHandler" validate ="false" />
</ httpHandlers >
< compilation debug ="true" >
< assemblies >
<!--
<addassembly="Microsoft.Web.Extensions,Version=1.0.61025.0,
Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
改为如下
-->
< add assembly ="System.Web.Extensions,Version=1.0.61025.0,
Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
</ assemblies >
</ compilation >
............
重新编译,运行即可.
如果配置Web.Config后运行仍然报错误,请将所有页面的中的 <asp:ScriptManager id="ScriptManager1" runat="server" AsyncPostBackTimeout="200">
</asp:ScriptManager>
紧跟在<Form>标记之后.