Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Captcha / First Look


Captcha Protection Mode Enabled


Settings
Protection Strategy:
Choose Protection Mode:
select
Text Settings:
Text Length:
select
Choose Font:
select
Text Color:
select
Background-Color:
select
Image Noise:
Background Noise Level:
select
Line Noise Level:
select
Font Warp Factor:
select

(does not trigger page validation)

  • Telerik RadCaptcha


    Telerik RadCaptcha is UI control that provides two major strategies for protection against automated form submissions:
    • Image with Modified Symbols (Captcha Image) - They are displayed in a form, and the user is required to input the symbols in a textbox. The Image is generated with an HttpHandler.
    • Automatic Robots Discovery - this strategy uses predefined rules which decide whether the input comes from a robot or not. At this point, there are two implemented rules that could be applied either separately or simultaneously.
      • Minimum form submission time - the presumption is that a human cannot input the fields in a form correctly for a time less than 3 seconds (this is set by default, and could be modified). If the submission is executed faster than the predefined value, it is assumed that the executor is a robot.
      • Invisible textbox in the form (the so-called "honeypot") - this rule requires the insertion of a textbox which is not visible when the form is styled. Still, it will be detected by a robot, and therefore if any data is entered, the executor is considered to be a robot.

    Key features:
    • Three Modes for Protection - you can easily define which strategies to be used for spam protection. These are: Captcha, InvisibleTextBox and MinimumTimeout.
    • Set Custom Error Message - the error message that is displayed when the condition being validated fails. Simply set the ErrorMessage property of the RadCaptcha and the value will be displayed if the page is not valid.
    • Background and Line Noise Level of the Captcha Image - you can easily control the background and the line noise of the Image by setting the respective value (None, Low, Medium, High or Extreme). The default value of the background and line noise level is Low.
    • Font Family and Font Warp of the Captcha Image - you can easily choose which font family to be used for the Image text. Courier New is used as a default value for the font family. Furthermore, the amount of random font warping to apply to the rendered text can be changed by setting the FontWarp property of the CaptchaImage. The default amount of font warping is Low.
    • Text Length and Possible Characters of the Captcha Image - the default length of the text is 5 characters, and the characters could be either letters or either numeric characters. Alternatively, you can choose what kind of characters to be used (only letters or only numeric characters), and change the length of the text.
    • Maximum Time Interval of the Captcha Image - the maximum number of minutes the Captcha Image will be cached and valid.
    • Minimum Timeout - minimum number of seconds the form must be displayed before it is valid. If you're too fast, you must be a robot. This is set when “Minimum form submission time” mode is used for Spam Protection.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Captcha.Default.DefaultCS" CodeFile="DefaultCS.aspx.cs" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <style type="text/css">
            .label
            {
                font-weight: bold;
            }
        </style>
        <qsf:HeadTag ID="Headtag1" runat="server" />
    </head>
    <body class="BODY">
        <form id="Form2" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" ShowSkinChooser="false" />
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"></telerik:RadFormDecorator>
        <script type="text/javascript">
            function fillInvisibleTextBox(sender)
            {
                var invisibleTextBox = $get("RadCaptcha1_InvisibleTextBox");
                if (sender.checked) {
                    invisibleTextBox.value = "Filled";
                }
                else {
                    invisibleTextBox.value = "";
                }
            }
        </script>
        <br />
        <table>
            <tr>
                <td style="vertical-align: top;">
                    <div style="width: 330px; height: 30px;">
                        <asp:Label ID="lblModeEnabled" runat="server" Text="Captcha Protection Mode Enabled" CssClass="label"></asp:Label>
                    </div>
                    <div style="width: 330px;">
                        <telerik:RadCaptcha ID="RadCaptcha1" runat="server" ErrorMessage="Page not valid. The code you entered is not valid."
                            ValidationGroup="Group">
                        </telerik:RadCaptcha>
                    </div>
                    <asp:Label ID="lblCorrectCode" runat="server" ForeColor="Green"></asp:Label>
                    <br />
                    <div style="margin: 10px 0 0 0;">
                        <asp:Button ID="btnVerify" runat="server" Text="Submit Page" Width="150px" ValidationGroup="Group" OnClick="btnVerify_Click" />
                    </div>
                </td>
                <td style="padding: 0 0 0 8px; vertical-align: top;">
                    <fieldset title="Settings" style="width: 330px; padding: 0 0 0 10px;">
                        <legend>Settings</legend><br />
                        <div>
                            <strong>Protection Strategy:</strong>
                            <div style="padding: 10px;">
                                <table style="width: 300px;">
                                    <tr>
                                        <td style="text-align: right; width: 150px;">
                                            <asp:Label ID="Label2" runat="server" Text="Choose Protection Mode:"></asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="ProtectionMode" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ProtectionMode_SelectedIndexChanged">
                                                <Items>
                                                    <telerik:RadComboBoxItem Value="Captcha" Text="Captcha" Selected="True" /><telerik:RadComboBoxItem Value="Invisible TextBox"
                                                        Text="Invisible TextBox" /><telerik:RadComboBoxItem Value="Minimum Submission" Text="Minimum Submission" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <asp:Panel ID="PanelCaptcha" runat="server">
                                <strong>Text Settings:</strong>
                                <div style="padding: 10px;">
                                    <table style="width: 300px">
                                        <tr>
                                            <td style="text-align: right; width: 150px;">
                                                <asp:Label ID="lblTextLength" runat="server" Text="Text Length: "></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="TextLength1" runat="server" OnSelectedIndexChanged="TextLength1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Value="3" Text="3 characters" /><telerik:RadComboBoxItem Value="4" Text="4 characters" />
                                                        <telerik:RadComboBoxItem Value="5" Text="5 characters" Selected="True" /><telerik:RadComboBoxItem Value="6"
                                                            Text="6 characters" /><telerik:RadComboBoxItem Value="7" Text="7 characters" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right">
                                                <asp:Label ID="lblFontFamily" runat="server" Text="Choose Font: "></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="FontFamily1" runat="server" OnSelectedIndexChanged="FontFamily1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="Courier New" Value="Courier New" Selected="True" /><telerik:RadComboBoxItem
                                                            Text="Tahoma" Value="Tahoma" /><telerik:RadComboBoxItem Text="Times New Roman" Value="Times New Roman" />
                                                        <telerik:RadComboBoxItem Text="Verdana" Value="Verdana" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right">
                                                <asp:Label ID="Label1" runat="server" Text="Text Color: "></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="Color1" runat="server" OnSelectedIndexChanged="Color1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="Gray" Value="Gray" Selected="True" /><telerik:RadComboBoxItem Text="Red"
                                                            Value="Red" /><telerik:RadComboBoxItem Text="Green" Value="Green" /><telerik:RadComboBoxItem Text="Blue"
                                                                Value="Blue" /><telerik:RadComboBoxItem Text="Black" Value="Black" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right">
                                             <asp:Label ID="lblChooseBColor" runat="server" Text="Background-Color: "></asp:Label>
                                            </td>
                                            <td>
                                             <telerik:RadComboBox ID="ddlChooseColor" runat="server" OnSelectedIndexChanged="ddlChooseColor_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="White" Value="White" Selected="True" />
                                                        <telerik:RadComboBoxItem Text="Black" Value="Black" />
                                                        <telerik:RadComboBoxItem Text="Red" Value="Red" />
                                                        <telerik:RadComboBoxItem Text="Green" Value="Green" />
                                                        <telerik:RadComboBoxItem Text="Blue" Value="Blue" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <strong>Image Noise:</strong>
                                <div style="padding: 10px;">
                                    <table style="width: 300px;">
                                        <tr>
                                            <td style="text-align: right; width: 150px;">
                                                <asp:Label ID="lblBacgroundNoise" runat="server" Text="Background Noise Level: "></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="BackNoise1" runat="server" OnSelectedIndexChanged="BackNoise1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="None" /><telerik:RadComboBoxItem Text="Low" Selected="True" /><telerik:RadComboBoxItem
                                                            Text="Medium" /><telerik:RadComboBoxItem Text="High" /><telerik:RadComboBoxItem Text="Extreme" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right">
                                                <asp:Label ID="lblLineNoise" runat="server" Text="Line Noise Level: "></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="LineNoise1" runat="server" OnSelectedIndexChanged="LineNoise1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="None" /><telerik:RadComboBoxItem Text="Low" Selected="True" /><telerik:RadComboBoxItem
                                                            Text="Medium" /><telerik:RadComboBoxItem Text="High" /><telerik:RadComboBoxItem Text="Extreme" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="text-align: right">
                                                <asp:Label ID="lblFontWarp1" runat="server" Text="Font Warp Factor: "></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox ID="FontWarp1" runat="server" OnSelectedIndexChanged="FontWarp1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="None" /><telerik:RadComboBoxItem Text="Low" Selected="True" /><telerik:RadComboBoxItem
                                                            Text="Medium" /><telerik:RadComboBoxItem Text="High" /><telerik:RadComboBoxItem Text="Extreme" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div style="padding: 5px 0 15px 0;">
                                    <asp:Button ID="Button1" runat="server" Text="Update Changes" Width="150px" CausesValidation="false" />
                                    <br />(does not trigger page validation)
                                </div>
                            </asp:Panel>
                            <asp:Panel ID="PanelMinTimeout" runat="server">
                                <strong>Minimum Submision Timeout:</strong>
                                <div style="padding: 10px;">
                                    <table style="width: 300px;">
                                        <tr>
                                            <td style="text-align: right; width: 150px;">
                                                <asp:Label ID="lblMinSubTimeout" runat="server" Text="Minimum Timeout:"></asp:Label>
                                            </td>
                                            <td>
                                                <telerik:RadComboBox AutoPostBack="true" ID="MinSubTimeout1" runat="server" OnSelectedIndexChanged="MinSubTimeout1_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Value="3" Text="3 seconds" Selected="True" /><telerik:RadComboBoxItem Value="6"
                                                            Text="6 seconds" /><telerik:RadComboBoxItem Value="9" Text="9 seconds" /><telerik:RadComboBoxItem Value="12"
                                                                Text="12 seconds" />
                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </asp:Panel>
                            <asp:Panel ID="PanelHiddenTB" runat="server">
                                <strong>Invisible Text Box:</strong>
                                <div style="padding: 5px;">
                                    <table>
                                        <tr>
                                            <td style="text-align: left">
                                                <input id="cbHiddenTB1" type="checkbox" name="cbHiddenTB1" onclick="fillInvisibleTextBox(this);" runat="server" />
                                                <asp:Label ID="lblShowHiddenBox" runat="server" Text="Fill-in invisible RadCaptcha TextBox to cause page invalidation"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </asp:Panel>
                        </div>
                    </fieldset>
                </td>
            </tr>
        </table>
        <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451