Monday, September 19, 2011

2. Captcha Control in asp.net

2. Captcha Control in asp.net

 Place Recaptcha.dll version 1.0.0.0.0 in Bin Folder and register it as:


<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>


<recaptcha:RecaptchaControl ID="recaptcha" runat="server"
        PublicKey="6LeJZ8cSAAAAANskjZFY_tU5swJTihJ6yqBa0jcb"
        PrivateKey="6LeJZ8cSAAAAAFJD3_Ww1KojLVtSHZ2ZcAUnjcW6"
        Theme="red"  />

// Theme=”red”, “White”, “blackglass” ,  ”clean”, “custom”

 --------------------------------

  protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            lblStatus.Text = "Captcha Validated!";
        }
        else
        {
            lblStatus.Text = "Invalid Captcha!";
        }
    }

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More