如何请求验证的HttpHandlers的禁用? [英] How can Request Validation be disabled for HttpHandlers?

查看:136
本文介绍了如何请求验证的HttpHandlers的禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能禁用请求验证为HttpHandlers的?

Is it possible to disable request validation for HttpHandlers?

一点背景知识 - 我有使用一个HttpHandler接收来自WorldPay的支付响应ASP.NET Web应用程序。 IIS日志表明处理器正在从WorldPay的正确调用,但处理器内部的code永远不会被调用。

A bit of background - I've got an ASP.NET web application using an HttpHandler to receive the payment response from WorldPay. The IIS logs show that the handler is being called correctly from WorldPay, but the code inside the handler is never called.

如果我创建一个物理ASPX页面和设置的 ValidateRequest = FALSE 的在头,并把同样的code在Page_Load方法中,code被称为没有任何问题。

If I create a physical ASPX page and set ValidateRequest=false in the header, and put the same code in the Page_Load method, the code is called without any problems.

这解决了这个问题,但我想preFER坚持使用一个HttpHandler这个,因为它是更适合于这种类型的功能,而不是一个空的ASPX页面,虽然这是依赖于能够禁用请求验证。

This solves the problem, though I'd prefer to stick with using an HttpHandler for this as it's better suited for this type of functionality, rather than having an empty ASPX page, though this is dependent on being able to disable request validation.

Web应用程序使用ASP.NET 2.0和服务器是IIS6。

The web application is using ASP.NET 2.0 and the server is IIS6.

推荐答案

在IIS6您可以简单地添加验证在web.config登记=FALSE

On IIS6 you can simply add validate="false" in the web.config registration.

<add path="handler.axd" type="Foo.Bar.MyHandler" verb="*" validate="false" />

如果任何人都可以阐明如何在IIS7的集成方式做到这一点一些轻,那将是非常有帮助了。

If anyone could shed some light on how to accomplish this in IIS7's integrated mode, it would be extremely helpful too.

这篇关于如何请求验证的HttpHandlers的禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆