Can we capture Captcha validate event on maxtimeout property

0 Answers 63 Views
Captcha
shaili
Top achievements
Rank 1
shaili asked on 13 Oct 2022, 05:23 PM

Hi Team,

Is is possible to figure out captcha isvalid property set to false due to maxtimeout property even though correct input provided and display different error message

Rumen
Telerik team
commented on 18 Oct 2022, 11:59 AM

Hi Shaili,

While the control does not offer an event attached to the CaptchaMaxTimeout, you can use a Button Click event to update the error text as shown below:

    protected void Button_Click(object sender, EventArgs e)
    {
        Response.Write(myRadCaptcha.IsValid);
        if (myRadCaptcha.IsValid == false)
        {
            myRadCaptcha.ErrorMessage = "session expired";
        }
    }

shaili
Top achievements
Rank 1
commented on 18 Oct 2022, 02:04 PM

Hi Rumen,

Thank you for your response. But here i want to want to know how to differenciate between timeout invalid and input invalid so that i can update error message appropriately. As per the above code i don know how the captcha was invalid wether due to timeout or invalid input.Is there any way we can differenciate this.

Rumen
Telerik team
commented on 20 Oct 2022, 01:25 PM

Thank you for the clarification!

I am afraid that there isn't a suitable event or a way to distinguish the invalid input from the session timeout.

The CaptchaMaxTimeout property expires with the session. If I understand you correctly you shouldn't be able to change much when the session is invalid and distinguish the session time out or the input validity when the session is invalid, because if you make a request with an expired session, it will fail with a session error.

Perhaps the best approach is to show a message to the user prior to the session expiration: Display Session Timeout message before Session expires in ASP.Net.

No answers yet. Maybe you can help?

Tags
Captcha
Asked by
shaili
Top achievements
Rank 1
Share this question
or