解决Asp.net页面找不到ajaxpro相关文件问题

来源:互联网 发布:衣柜合理布局 知乎 编辑:程序博客网 时间:2024/06/08 17:53

在vs2015 IDE环境编程,使用自带的iis服务器调试程序

IS7 下

方法一:

修改配置文件:

将此 <system.webServer> 节点的<handlers>中增加ajaxpro的handle

<add  name="ajaxpro" path="ajaxpro/*.ashx" verb="POST,GET" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>

注:配置中其他地方加的此handle的可以考虑删除。

//前台js方法处调用的程序 

function GetBindData() { 
        var Balance = STL.UserPage.GetBindData().value;//名称空间.类名.方法名
        document.getElementById("lbUserBalance").innerText = Balance;
    }

//cs后台类中的方法写法

[AjaxPro.AjaxMethod]
    public string GetBindData()
    {
        return “这是测试”;
    }

方法二:

修改站点相应的应用程序池属性:

把属性:托管管道模式=>经典 模式

或者直接选择默认的Classic .NET AppPool  这个应用程序池。

tags:IIS7 url重写找不到页面 ajaxpro iis7 js提示未定义 IIS7问题
vista+iis7.0下无法使用ajaxpro ashx图片不显示
asp.net rewrite实现的伪静态 显示404错误



IIS6 表示方法:

<configuration>
  
        <configSections>
            <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
        </configSections>
        <RewriterConfig>
            <Rules>
                <RewriterRule>
                    <LookFor>~/Index.aspx</LookFor>
                  <SendTo>~/Content/Index.aspx</SendTo>
              </RewriterRule>
          </Rules>
      </RewriterConfig>
  
      <system.web>
          <httpHandlers>
             <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
          </httpHandlers>
      </system.web>

</configuration>

0 0
原创粉丝点击