<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ASPGcaptcha._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <h3>Contact Us form in ASP.NET with Google Captcha</h3>
    <div>
        <table>
            <tr>
                <td>Full Name:</td>
                <td>
                    <asp:TextBox ID="txtFullName" runat="server" />
                </td>
            </tr>
            <tr>
                <td>Email:</td>
                <td>
                    <asp:TextBox ID="txtEmail" runat="server" />
                </td>
            </tr>
            <tr>
                <td>Contact No:</td>
                <td>
                    <asp:TextBox ID="txtContactNo" runat="server" />
                </td>
            </tr>
            <tr>
                <td>Query</td>
                <td>
                    <asp:TextBox ID="txtQuery" runat="server" TextMode="MultiLine" Height="66px" Width="297px" />
                </td>
            </tr>
            <tr>
                <td>Security Code</td>
                <td>
                    <%--  We Can get the code from : https://developers.google.com/recaptcha/docs/display  --%>                    <%-- Here Please place you public key(google captcha public key) your_public_key--%>
                    <%-- Here Please place you public key(google captcha public key) your_public_key--%>
                    <script type="text/javascript"
                        src="http://www.google.com/recaptcha/api/challenge?k=Your public key here">
                    </script>
                    <noscript>
                        <iframe src="http://www.google.com/recaptcha/api/noscript?k=Your public key here"
                            height="300" width="500" frameborder="0"></iframe>
                        <br>
                        <textarea name="recaptcha_challenge_field" rows="3" cols="40">
                         </textarea>
                        <input type="hidden" name="recaptcha_response_field"
                            value="manual_challenge">
                    </noscript>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>
                    <asp:Label ID="lblMsg" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>


Posted By : Sourav Mondal