Essential Studio for Asp.Net | Demos

SHOWCASE SAMPLES
Showcase samples
    LayoutSection_ControlsSection_captcha1
    <%@ Page Title="Default Functionalities of ASP.NET Captcha control | Syncfusion" Language="C#" MasterPageFile="~/Samplebrowser.Master" AutoEventWireup="true" CodeBehind="DefaultFunctionalities.aspx.cs" Inherits="WebSampleBrowser.Captcha.DefaultFunctionalities" %>
    
    <asp:Content ID="Content2" ContentPlaceHolderID="ControlsSection" runat="server">
        <div class="frame" style="width: 500px">
            <div class="control">
                <table class="tabprop">
                    <tr>
                        <td>
                            <div style="width: 185px;">
                                <ej:Captcha ID="captcha1" Mapper="GetCurrentItem" ShowAudioButton="true" ShowRefreshButton="true" EnableAutoValidation="true" CustomErrorMessage="Invalid Captcha" TargetButton="btnSubmit" runat="server"></ej:Captcha>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <ej:Button ID="btnSubmit" runat="server" Text="Submit" Size="Large" Type="Button" ClientSideOnClick="onValidate"></ej:Button>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </asp:Content>
    <asp:Content ID="Content1" ContentPlaceHolderID="ScriptSection" runat="server">
        <script type="text/javascript">
            function onValidate(args) {
                var value = $("#<%=captcha1.ClientID%>_CaptchaMessage")[0].innerHTML;
                if (value != "Invalid Captcha") {
                    alert("Thank you for registering");
                }
            }
        </script>
        <style type="text/css">
            .control {
                width:155px;
                margin: 0 auto;
            }
        </style>
    </asp:Content>
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebSampleBrowser.Captcha
    {
        public partial class DefaultFunctionalities : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
            [System.Web.Services.WebMethod]
            public static string GetCurrentItem(Dictionary<object, object> captchaModel)
            {
                return Syncfusion.JavaScript.Web.Captcha.GetModel(captchaModel).ExecuteResult();
            }
        }
    }