![]() |
|||||||
|
ASP.NET Library for reCAPTCHAThe reCAPTCHA ASP.NET Library provides a simple way to place a CAPTCHA on your ASP.NET website, helping you stop bots from abusing your website. The library wraps the reCAPTCHA API. You can use the library from any .NET language including C# and Visual Basic .NET. reCAPTCHA QuickstartThese instructions should get you started quickly.
ExampleThe following is a "Hello World" with reCAPTCHA using Visual Basic. A C# sample is included with the library download:
<%@ Page Language="VB" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<script runat=server>
Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
If Page.IsValid Then
lblResult.Text = "You Got It!"
lblResult.ForeColor = Drawing.Color.Green
Else
lblResult.Text = "Incorrect"
lblResult.ForeColor = Drawing.Color.Red
End If
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:Label Visible=false ID="lblResult" runat="server" />
<recaptcha:RecaptchaControl
ID="recaptcha"
runat="server"
PublicKey=""
PrivateKey=""
/>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
</form>
</body>
</html>
Customizing client side behaviorThere are many options available to customize the look and feel of the client side code. You can even create your own theme. Look at our client API guide for more information on this topic. | ||||||