在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>