zoukankan      html  css  js  c++  java
  • ajaxpro ajaxMethod Error:

    今天项目开发过程中,偶然发现了ajaxpro报错 This method is either not marked with an AjaxMethod or is not availab

    在google了半天后,终于发现一个解决方案

    How to prevent System.NotSupportedException: This method is either not marked with an AjaxMethod or is not available
    在曾在谷歌有关System.NotSupportedException一批又改变App_Code文件夹中的文件进行讨论。 The was a discussion at the Google group about the System.NotSupportedException after changing files in App_Code folder. 由于没有固定的App_Code文件夹,将在每一个“重建”一个新名称,将看起来很奇怪的生成assmebly名称。 As there is no static assmebly name for the App_Code folder it will generated on each "rebuild" a new name that will look like very strange. 该程序集的名称是用于任何AjaxPro的呼吁,这将是一个问题,在不久之后的JavaScript包装发送给客户端的名称更改。 The name of the assembly is used for any AjaxPro call and this will be a problem when the name changes after sending the JavaScript wrapper to the client.
    为了避免这种情况有一个Web.config中指定类型映射选项。 To prevent this there is an option in web.config to specify type mappings. 见下面的例子: See the example below:
        <ajaxNet> <ajaxNet>
        <ajaxSettings> <ajaxSettings>
        <urlNamespaceMappings> <urlNamespaceMappings>
        <添加type=" Namespace.Classname,AssemblyName“path=" mypath中 "/> <add type=" Namespace.Classname,AssemblyName " path=" mypath "/>
        “/ urlNamespaceMappings” </urlNamespaceMappings>
        “/ ajaxSettings” </ajaxSettings>
        “/ ajaxNet” </ajaxNet>
    如果你现在使用的App_Code文件夹中,您可以使用您的程序集名称App_Code文件的方法: If you are now using methods in your App_Code folder you can use App_Code as your assembly name:
        <ajaxNet> <ajaxNet>
        <ajaxSettings> <ajaxSettings>
        <urlNamespaceMappings> <urlNamespaceMappings>
        <添加type=" Namespace.Classname,App_Code“path=" mypath中 "/> <add type=" Namespace.Classname,App_Code " path=" mypath "/>
        “/ urlNamespaceMappings” </urlNamespaceMappings>
        “/ ajaxSettings” </ajaxSettings>
        “/ ajaxNet” </ajaxNet>
    这将迫使AjaxPro使用短名称每次而不是默认的程序集名称的变化。 This will force AjaxPro to use the short name everytime instead of the changing assembly name by default.

  • 相关阅读:
    js中常见的异步操作有哪些?
    z-index
    transition和animation的区别?
    JS 中遇到有特殊字符或者空格时会被转译该怎么办?
    url参数中有+、空格、=、%、&、#等特殊符号无法显示怎么办?
    JS如何删除对象中的某一属性?
    splice和slice、map和forEach、 filter()、reduce()的区别
    css呼吸灯效果
    mescroll—移动端精致的下拉刷新和上拉加载js框架(支持Vue)
    血淋淋的教训—将Vue项目打包成app的跨域问题
  • 原文地址:https://www.cnblogs.com/underwing/p/1625578.html
Copyright © 2011-2022 走看看