【问题标题】:unable to including ajax file无法包含 ajax 文件
【发布时间】:2014-12-06 01:37:23
【问题描述】:

我在尝试设置 Ajax 时从 IE 收到此错误消息

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'Ajax' or one of its dependencies. The system cannot find the file specified.

Source Error: 


Line 13:       <!-- Register the ajax handler -->
Line 14:       <add verb="POST,GET" path="ajax/*.ashx"
Line 15:            type="Ajax.PageHandlerFactory, Ajax" />
Line 16:     </httpHandlers>
Line 17: 

我添加到我的bin文件夹的文件是AjaxPro.dll,我已经将上面的代码添加到了配置文件中。

谁能告诉我如何解决这个问题?

P.S 我一直以此为指导 MSDN Page

【问题讨论】:

    标签: c# html ajax visual-studio-2010


    【解决方案1】:

    试试看

    添加对 AjaxPro.2.dll 的引用

    (对于 .NET 1.1 框架使用 AjaxPro.dll)

    将以下行添加到您的 web.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <httpHandlers>
          <add verb="POST,GET" path="ajaxpro/*.ashx" 
                 type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
        </httpHandlers>
    
    ...
    

    对于 .NET 1.1 框架,使用 AjaxPro.dll
    将以下行添加到您的 web.config:

        <?xml version="1.0" encoding="utf-8" ?>
        <configuration>
          <system.web>
            <httpHandlers>
              <add verb="POST,GET" path="ajaxpro/*.ashx"
                     type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
    
    ...
    

    【讨论】:

      【解决方案2】:

      我也面临同样的问题。目前我的网络配置是

        <system.webServer>
               <handlers>
                    <add name="AjaxPro" verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
                </handlers>
            <validation validateIntegratedModeConfiguration="false" />
        </system.webServer>
      

      它工作正常。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-02-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-07-10
        • 2015-02-11
        • 2016-09-02
        相关资源
        最近更新 更多