locked
Recaptcha Control keeping Page.IsValid() always false. RRS feed

  • Question

  • User1575898411 posted

    I am using recaptcha control and it is always keeping Page.Isvalid false. 


    Thanks.

    Thursday, September 23, 2010 7:05 AM

Answers

  • User-1614194436 posted

    i dont think so it is possible i am giving you my sample code compare it or try to get new api key it may solve problem



    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AnotherCapchu.aspx.cs" Inherits="AnotherCapchu" %>
    <%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <recaptcha:RecaptchaControl
        ID="recaptcha"
        runat="server"
        PublicKey="6LeUS70SAAAAAGVK9oomx8q1rJDg607uvLbH9Ni3"
        PrivateKey="6LeUS70SAAAAADbKYFeMws-jhgmQIAwfkfTRm70r"
        />
            <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        </div>
        </form>
    </body>
    </html>




    protected void Button1_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Page.RegisterStartupScript("asd", "<script labguage='javascript'>alert('success');</script>");
            }
            else
            {
                Page.RegisterStartupScript("asd", "<script labguage='javascript'>alert('un success');</script>");
            }
        }


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 23, 2010 7:40 AM