In order to stop malicious applications (robots) from submitting your forms over and over again creating extremely painful data and performance problems the best thing you can do is add captcha to your forms.
Captcha stands for “Completely Automated Public Turing test to tell Computers and Humans Apart”. It uses an image containing deformed text which is impossible for computers to read but can be deciphered by a human. When submitting a form the user must enter the text correctly which is validated by the Captcha control. If the text is correct the validation passes if not it fails. When the validation fails the form cannot be submitted.
A nice free Captcha library and services is the ReCaptcha services which is completely free and extremely easy to use.
1. Download the library
2. Register for an API key
3. Add a reference to that library
4. Register the control on the page
5. Add the control to the page
<recaptcha:RecaptchaControlID="recaptcha"runat="server"PublicKey=""PrivateKey=""/>
6. Validate the ReCaptcha control in a form event
recaptcha.Validate();if (!recaptcha.IsValid)
{e.Cancel = true;
}else
{recaptcha.Visible = false;
}
Published by