In this article I will explain how to configure Mondor MSCaptcha in IIS Server. Many developers are complaining that the Mondor MSCaptcha does not show Captcha image when the project is hosted in IIS server and mainly the issue is occurring in IIS7 and IIS8 versions as they have Classic as well as Integrated Pipeline Application Pools.
Thus in this short article I’ll cover the steps needed to make the Mondor Captcha show image on IIS Server.
In IIS we have two modes of Application Pool Classic and Integrated hence based on the type of Application Pool used by your application, you will need to add the following Handlers in your project’s Web.Config file.
IIS Classic Application Pool
You will need to add the following handler to <httpHandlers> in <system.web> section of your Web.Config.
<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
And after adding your Web.Config should look like this.
<system.web>
<httpHandlers>
<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
</httpHandlers>
</system.web>
IIS Integrated Application Pool
You will need to add the following handler to <handlers> in <system.webServer> section of your Web.Config.
<add name="CaptchaImage" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
And after adding your Web.Config should look like this.
<system.webServer>
<handlers>
<add name="CaptchaImage" verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
</handlers>
</system.webServer>
And if your site makes use of Authentication then you must allow CaptchaImage.axd for all users by adding <location> tag in your Web.Config file.
<location path="CaptchaImage.axd">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>
Demo
Downloads