views:

273

answers:

1

I am using recaptcha in an ASP.NET 3.5 application and for some odd reason the ErrorMessage property is not working. Below is my code

 <recaptcha:RecaptchaControl ID="recaptcha" runat="server" PublicKey="*******************************" PrivateKey="*******************" Theme="white" ErrorMessage="This is an typo error"  />

When the typed text doesn't match with the recaptcha image text it still shows the default error message "Incorrect. Try again." instead of my custom error message. What could be the reason for this strange behavior

A: 

You put the message in a Literal tag. Here is my code snippet:

                                    <tr>
                                        <td align="center" colspan="2" >
                                        <recaptcha:RecaptchaControl Theme="white"  ID="recaptcha" runat="server" PrivateKey="*************"
                                                PublicKey="*************" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2" style="color: red">
                                            <asp:Literal ID="FailureText" runat="server" EnableViewState="False" Text="You have not entered the verification words correctly. Please try again."></asp:Literal>
                                        </td>
                                    </tr>
  • Mike
Mike