MSCaptcha Web.config httpHandler错误

use*_*282 2 c# asp.net web-config recaptcha

我想在我的项目中使用Recaptcha,我的web.config文件中存在以下问题.

<httpHandlers>
    <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
</httpHandlers>
<pages>
    <controls>
        <add tagPrefix="cc1" assembly="MSCaptcha" namespace="MSCaptcha" />
    </controls>
</pages>
Run Code Online (Sandbox Code Playgroud)

我的错误:

HTTP错误500.23 - 内部服务器错误

检测到的ASP.NET设置不适用于集成管理管道模式.

最可能的原因:

此应用程序在system.web/httpHandlers部分中定义配置.

Uro*_*jat 9

您似乎在IIS 7.0或更高版本上以集成模式运行应用程序.

在集成模式下运行时,您应该注册HTTP处理程序,如下所示:

<configuration>
  <system.web>
        ....
  </system.web>
  <system.webServer>
    <handlers>
<add name="CAPTCHAHandler" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
    </handlers>
  </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

此致,Uros