自定义处理Asp.NET开发服务器上而不是在IIS 5.1的工作?
-
05-09-2019 - |
题
嗨,大家好,香港专业教育学院得到了一个愚蠢的问题。
我的自定义处理程序Asp.NET开发服务器上工作的100%,但是当我发布该网站IIS 5.1每当我尝试运行评论/查找(其中通过Ajax调用发现用户)(我知道的命名我处理程序SUX !!! :)
我得到这个错误:
在页面无法显示 您正在查找的页面无法显示,因为页面地址不正确。
请尝试以下方法:
* If you typed the page address in the Address bar, check that it is entered correctly.
* Open the home page and then look for links to the information you want.
HTTP 405 - 资源不允许 互联网信息服务
技术信息(对于支持人员)
* More information:
Microsoft Support
我对AJAX调用代码是:
function findUser(skip, take) {
http.open("post", 'Comment/FindUser', true);
//make a connection to the server ... specifying that you intend to make a GET request
//to the server. Specifiy the page name and the URL parameters to send
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader('Criteria', document.getElementById('SearchCriteria').value);
http.setRequestHeader("Skip", skip);
http.setRequestHeader("Take", take);
http.setRequestHeader("Connection", "close");
//display loading gif
document.getElementById('ctl00_ContentPlaceHolder1_DivUsers').innerHTML = 'Loading, Please Wait...<br /><img src="Images/loading.gif" /><br /><br />';
//assign a handler for the response
http.onreadystatechange = function() { findUserAction(); };
//actually send the request to the server
http.send(null);
}
请谁能帮助我?
解决方案
确认您已经允许IIS服务器上的扩展。开发服务器执行此automatially你。
如果你打开网站的属性然后转到主目录选项卡并单击配置按钮。
在那里尝试加入您使用的处理程序指向扩展。可执行文件设置为ASPNET_ISAPI.DLL(看标准.aspx扩展到找到它是您的计算机上),并取消选中“检查文件是否存在。”
我已经通过此一对夫妇的时间烧和这个排序的问题
科林ģ
其他提示
在IIS不是所有呼叫将被asp.net处理程序来处理(不同于卡西尼开发服务器),除非该呼叫中的.aspx,.ashx的等.NET ISAPI DLL将不会处理该呼叫结束。
在线索是在
HTTP 405 - 资源不允许Internet信息服务
您还需要映射处理程序在web.config如果没有在文件系统中的相应文件.ashx的
的问题是,当我呼吁dev的该处理程序。服务器我打电话它liek此
http.open("post", 'Comment/Rate', true);
因为在我的web.config我指示它捕获所有“评论/” URL和调用CommentHandler.ashx到处理器了。
<add verb="*" path="Comment/*" type="CoffeeMashup2.CommentHandler"/>
但是由于某种原因,在IIS它没有工作,所以我改变上述呼叫到
http.open("post", 'CommentHandler.ashx/Rate', true);
和它的工作100%
非常感谢你们的帮助。
不隶属于 StackOverflow