1

I am using reCAPTCHA with ASP.NET. When I use <recaptcha:RecaptchaControl> separately it works fine, bu when I add it to the <asp:CreateUserWizard>'s <WizardSteps> I get System.NotImplementedException: This setter is not implemented. This is my code:

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
  OnCreatingUser="CreateUserWizard1_CreatingUser">
  <WizardSteps>
    <asp:WizardStep ID="CreateUserWizardStep0" runat="server"> 
      <recaptcha:RecaptchaControl 
        ID="recaptcha" 
        runat="server" 
        Theme="" 
        PublicKey="my_public_key" 
        PrivateKey="my_private_key" 
        IsValid="False" 
        />
    </asp:WizardStep> 
    <asp:CreateUserWizardStep runat="server" Title="Yeni admin yarat" />
    <asp:CompleteWizardStep runat="server" Title="Tamamla" />
  </WizardSteps>
</asp:CreateUserWizard>

And this is my codebehind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Registration : System.Web.UI.Page
{

    protected void CreateUserWizard1_CreatingUser(object sender, LoginCancelEventArgs e)
    {
      Recaptcha.RecaptchaControl captcha =
       (Recaptcha.RecaptchaControl)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("recaptcha");
      if (null == captcha)
      {
        e.Cancel = true;
        return;
      }
      captcha.Validate();
      if (!captcha.IsValid)
      {
        //TODO: Display validation message.
        e.Cancel = true;
        return;
      }
      e.Cancel = false;
    }
}

What is the reason of this exception? Any help would be much appreciated

gdrt
  • 3,160
  • 4
  • 37
  • 56

0 Answers0