How to Use Captcha Image in Asp.Net Webform Using C#
In today's post i am going to cover "How to Use Captcha Image in Asp.Net Webform Using C#? In the previous tutorials i have explained sealed class ,Abstract class ,Ajax call,Ref and Out Keyword,Autoeventwireup Event in Asp.Net,Bind asp.net dropdown list using jquery etc.
Now add below code to validate the captcha in Asp.net webform.
Before implementing the Captcha in Asp.Net webform let's discuss about "Why require CAPTCHA?" Answer is spamming, in today's world many uses different - different approaches that automatically fills the form using some scripts or code.Here Captcha comes into the picture because Captcha is an image that have random codes which can not be read by any script. This process is also known as Robot check.
Now i will show you how to use Captcha image in Asp.net Webform and prevent from getting misused.
Here I am using BotDetect third party captcha control.To get BotDetect captcha control either you download it and add to bin folder of your application and add a reference or you can use Nuget package manager to download.
Here is the screen how to add reference using nuget package manager.
- Right click on reference folder of your applicatio.
- Click on manage nuget packages
- Search for BotDetect and install the Captcha package.(See below screenshot for reference)
To add BotDetect Captcha package refer below screen.
Now add HTML markup to build the basic form.
Now add below code to validate the captcha in Asp.net webform.
As we have done with the implemention part.We are just one step away from our goal.Yes, we need to add some configuration in web.config file.Below is the section that needs to be added to web.config.
Add below in <system.web> section
Add below in <pages> section
Add below in <system.webserver> section
Add below in <system.web> section
Add below in <pages> section
Add below in <system.webserver> section
I hope you have learn how to integrate BotDetect captcha control in Asp.Net webform and how it works. I would like to have feedback from my readers. Your valuable feedback, question, or comments about this article are always welcome.
Thanks.
Thanks.
How to Use Captcha Image in Asp.Net Webform Using C#
Reviewed by CodiBucket
on
09:39
Rating:
No comments: