Text version of the video
Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
All ASP .NET Text Articles
All ASP .NET Slides
All Dot Net and SQL Server Tutorials in English
All Dot Net and SQL Server Tutorials in Arabic
In this video, we will discuss using captcha control in asp.net web application.
What is the use of Captcha control
The term CAPTCHA stands for Completely Automated Public Turing Test To Tell Computers and Humans Apart. The following are the 2 most compelling reason for using captcha control
1. To prevent automated computer programs from submitting comments (SPAM). CAPTCHA control ensures only humans can enter comments.
2. To prevent bogus user registrations. For example, when you try to create a new gmail account, notice that there is a captcha control displayed on the registration page. This ensures only humans can register and not automated scripts.
It is very difficult for automated computer programs to read the distorted text displayed in a captcha control.
Example : The data entered in the webform below should only be saved to the database table when captcha control passes validation.
There are several free captcha controls available on the internet. I have tested reCAPTCHA control with ASP.NET and works very well. It is very easy to integrate as well. Here are the steps.
Step 1 : Sign up for API keys.
Step 2 : Download reCAPTCHA ASP.NET library
Step 3 : Extract Recaptcha.dll from the downloaded ZIP folder
Step 4 : In your ASP.NET web project, add a reference to Recaptcha.dll assembly
Step 5 : Include the following Register directive on the page
[%@ Register TagPrefix"recaptcha" Namespace"Recaptcha" Assembly"Recaptcha" %]
Step 6 : Add the control declaration on the page where you want the captcha control
[recaptcha:RecaptchaControl ID"recaptcha" runat"server" PublicKey"your_public_key" PrivateKey"your_private_key" /]
Step 7: In the code-behind file check Page.IsValid property
// If Page.IsValid returns true, captcha control has succeeded validation.
// ADO.NET code to save data to the database
// If Page.IsValid returns false, captcha control has failed validation.
// Display error message to the user