Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
WebCaptcha Never Validates
posted

I'm attempting to implement a WebCaptcha (2011.1) in VS2010 using .NET 4.0. Whenever I attempt to validate the results of the WebCaptcha, it fails. On inspection, I've noticed that the Value of the captcha in a breakpoint after postback is an empty string.

I'm attempting to implement it as part of a user registration process inside a CreateUserWizard step.

Here's the declaration of the control in the markup:

<ig:WebCaptcha ID="WebCaptcha1" runat="server" Width="250px">
  <InputValueEditor NullText="write text from image" Width="175px" 
ID
="_editor"></InputValueEditor>   <SubmitButton Text="Submit" Visible="False"></SubmitButton> </ig:WebCaptcha>

It's all the default settings, except for hiding the submit button, but it fails when I use the submit button from the control itself anyway.

Here's the code for checking the validation on CreatingUser event:

Dim captcha As WebCaptcha = CType(Me.RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("WebCaptcha1"), WebCaptcha)
captcha.Validate()
If Not captcha.IsValid Then
   e.Cancel = True
End If

There's not much more code to share but I can put up anything that's needed.

Thanks.