Plazza Sele
Plazza Sele

Reputation: 319

Internal Server Error 500. web.config

I am getting this error: 500 Internal Server Error I have a captcha in my contact.aspx file, and in the web.config i have a line of code(), if i delete this line the page runs ok, but the captcha image is not shown.! can any one please help. this is the code in web.config:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
<system.web>
    <httpHandlers>
      <add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler,MSCaptcha"/>
    </httpHandlers>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>
</configuration>

Upvotes: 1

Views: 1992

Answers (2)

Plazza Sele
Plazza Sele

Reputation: 319

I found the answer. the right code should be like this:

<configuration>
  <system.web>
        ....
  </system.web>
  <system.webServer>
    <handlers>
<add name="CAPTCHAHandler" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
    </handlers>
  </system.webServer>
</configuration>

Upvotes: 2

Irvin Dominin
Irvin Dominin

Reputation: 30993

Probably you are running in integrated mode, in this case you have to register your handler in another section like:

<configuration>
  <system.webServer>
    <handlers>
<add name="CaptchaImageHandler" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
    </handlers>
  </system.webServer>
</configuration>

and remember to remove your current handler definition present in the httpHandlers section.

Upvotes: 2

Related Questions