AjaxPro 在本地工作,但在服务器上我收到 .ashx 错误
在本地,我的应用程序使用 ajaxpro 工作正常,但在服务器上我似乎无法弄清楚为什么它不起作用。
使用 firebug 我有以下错误:
GET prototype.ashx 404 not found 获取 core.ashx 404 未找到 GET ms.ashx 404 not found
相同的代码在本地工作,所以它一定是 IIS7 设置?
编辑,我的 web.config
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
也有:
<location path="ajaxpro">
<system.web>
<httpHandlers>
<add verb="POST,GET" path="*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
和:
<location path="ajaxpro/prototype.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/core.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/converter.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
Locally my application works fine using ajaxpro, but on the server I can't seem to figure out why it is not working.
using firebug I have the following erros:
GET prototype.ashx 404 not found
GET core.ashx 404 not found
GET ms.ashx 404 not found
Same code works locally, so it must be a IIS7 setting?
edit, my web.config
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
also have:
<location path="ajaxpro">
<system.web>
<httpHandlers>
<add verb="POST,GET" path="*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
and:
<location path="ajaxpro/prototype.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/core.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="ajaxpro/converter.ashx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
为了使 AjaxPro.dll 在 IIS7 中工作,您应该将应用程序池的 PipelinMode 设置为 Classical 而不是 Integrated。
我曾尝试到处寻找这个,但最终这救了我。
For AjaxPro.dll to work in IIS7 you should set your application pool's PipelinMode to Classical instead of Integrated.
I have tried everywhere to find this but at the end this was what saved me.
要在 IIS7(即 Windows Vista)上以集成模式而不是经典模式运行 Ajax.NET,您必须检查两件事:
%windir%\system32\inetsrv\Appcmd migrate config ""
Ajax.NET Professional 的重大更改是您必须将 httpHandler(以及 httpModule,如果使用)移动到新部分 system.webServer 并将 httpHandler 重命名为 handler; 接下来,您必须为处理程序添加名称属性:
To run Ajax.NET on IIS7 (i.e. Windows Vista) in integrated mode instead of classic mode here are two things you have to check:
%windir%\system32\inetsrv\Appcmd migrate config ""
The breaking change for Ajax.NET Professional is that you have to move the httpHandler (and httpModule if used) to a new section system.webServer and rename httpHandler to handler; next you have to add a name attribute for the handler:
您确定已在 web.config 文件中正确注册了处理程序吗?
您的 web.config 文件中应该有如下所示的内容。
您还需要在 Bin 目录中包含 AjaxPro dll(至少对于网站而言)。
Are you sure that you have the handlers registered properly in the web.config file?
You should have something that looks like the following in your web.config file.
You also need to have the AjaxPro dll in your Bin directory (for a web site, at least).
我已经对这个问题绞尽脑汁了几个小时,我想我可能刚刚找到了解决方案......而且它相当,呃......令人沮丧。
在 web.config、system.webServer/handlers 中,可能有多个项目处理 *.ashx
,例如:
如果 ajaxpro 条目位于这些条目之下,则不会使用它,因为这些条目匹配第一的。
将
ajaxpro
条目移至其他条目上方可能会解决该问题。我不知道为什么卡西尼不介意,但 IIS7 介意......
I've been banging my head against this issue for a couple of hours, and I think I may have just found a solution... and it's rather, errr... frustrating.
In web.config, system.webServer/handlers, there may be more than one item that handles *.ashx
eg:
If the ajaxpro entry is below these, it will not be used, as these entries match first.
Moving the
ajaxpro
entry above the others might solve the problem.I have no idea why cassini doesn't mind, but IIS7 does...
Windows 2008 \ IIS 7 默认情况下没有为使用 Ajax 设置 axd 处理程序映射,因此如果您想使用 Ajax 并且使用我们的 Windows 2008 托管计划之一,则需要将以下代码放入 web.config 文件中。
或者将 .dll 复制到 bin 文件夹并尝试:
Windows 2008 \ IIS 7 doesn't have the axd handler mapping set up by default for using Ajax so you need to put the following code into your web.config file if you want to use Ajax and are on one of our Windows 2008 hosting plans.
or copy the .dll to the bin folder and try that:
我只是遇到了同样的错误,但原因可能与您不同。 我在一个新网站(本地运行)上得到了它,因为该网站使用了不排除 .ashx 的自定义 url 重写模块!
所以我的解决方案是确保重写模块排除带有 .ashx 的路径...
I just had the same error but probably for a different reason than you did. I got it on a new website (running locally) because the website was using a custom url rewrite module that didn't exclude .ashx!
So the solution for me was to make sure the rewrite module excluded paths with .ashx...
将我的 webform 迁移到 MVC 4 后,我得到了这个错误( ajaxpro/core.ashx 404 not found)
我解决了这个问题,将这一行添加到我的 app_start/routeconfig
我的 web.config 不需要额外的声明,但是这个
,当然还有一个引用放在我的 bin 文件夹中的 ajaxpro.2.dll
希望这有用!
I got this error ( ajaxpro/core.ashx 404 not found) after migrating my webform to MVC 4
I solved it adding this line to my app_start/routeconfig
My web.config didn`t need extra declarations but this one
and of course, a reference to ajaxpro.2.dll placed in my bin folder
Hope this to be usefull !