• Sys未定义


    1. 如果我们不是建的默认的Ajax站点,一般都会报这个错,只要在webconfig的<system.web>节点下加如下段代码就OK了.

    <httpHandlers>
       <remove verb="*" path="*.asmx"/>
       <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="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
       <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
      </httpHandlers>

    2.如果使用PageMethods访问aspx文件中的static方法同时还要加上如下代码,不然则找不到指定的方法

    <httpModules>
       <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </httpModules>

    3.当然了,最好还是建一个Ajax站点.这样都不需要去配置这些东西. .net开发环境会自动帮我们配置好上面那些设置.

  • 相关阅读:
    链表
    线程池 ------ linux C实现
    thymeleaf 标签使用方法
    thymeleaf的配置
    exception processing, template error resolving template
    Thymeleaf模板表达式
    Mybatis:使用bean传值,当传入值为Null时,提示“无效的列类型”的解决办法
    windows 查看端口
    session与cookie的区别
    substr与substring的区别
  • 原文地址:https://www.cnblogs.com/EricChan/p/1488126.html
Copyright © 2020-2023  润新知