Using ASP NET validation controls with recaptcha

  • دعنا نشارك هذا :
ترتيب الدرس : 167
المدة : 00:05:11
التحكم :
Link for all dot net and sql server video tutorial playlists

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.

Link for slides, code samples and text version of the video

In this video, we will discuss using ASP.NET validation controls with recaptcha control. This is continuation to Part 166. Please watch Part 166, before proceeding.

If you have a validation summary control on the page and if the Recaptcha control has failed validation it automatically displays the error message in Validation Summary control. All you need is a validation summary control on the page where you want the error message to appear.

Include validation summary control on the page
[asp:ValidationSummary ID"ValidationSummary1" runat"server" ForeColor"Red" /]

Run the application and click the Submit Button. Notice that the error message is displayed in the validation summary control as expected.

Now let's discuss using a custom validator control with the recaptcha control. When the word verification fails we want to display a RED asterisk () next to the captcha control and the error message in validation summary control.

To achieve this
Step 1 : Include the custom validator on the page where you want the RED asterisk () to appear
[asp:CustomValidator ID"CustomValidator1" runat"server" Text"" ForeColor"Red"

Step 2 : Include the server side validation method in the code-behind file
protected void RecaptchaValidator_ServerValidate(object sender, ServerValidateEventArgs e)

سيتم تفعيل التعليقات قريبا

Sep 23, 2020 07:32:27