Dear Telerik
Please could you advise if there is a workaround for my scenario, which is causing inconsistent validation behaviour in the radCaptcha control.
I have an ASCX user control in which a radCaptcha is added DECLARATIVELY in the ASCX markup. I use the <captchacontrol_id>.Validate and Page.Validate(<myvalidationgroup>) functions in my server-side button handler. On the user's first attempt to use the page to postback with validation, the IsValid property switches incorrectly to False as a result of running these functions, even if the captcha code is entered correctly. However, if the user tries again, the validation is successful, with the expected IsValid value of False being shown.
I do not believe this is directly a problem with my code, because this behaviour is only seen in the situation when the HttpRuntime process has to start up to serve the page. If the process is already running from previous requests, the 'first attempt failure' problem I describe above does not occur. It is as though the httphandler in Telerik.Web.UI.WebResource.axd is not ready until after the first postback. I have tried using the HttpHandlerUrl property to see if this serves to 'preload' the httphandler, but this does not seem to make any difference, e.g.:
myCaptchaId.HttpHandlerUrl = "~/Telerik.Web.UI.WebResource.axd"
I have also tried moving the <captchacontrol_id>.Validate and/or Page.Validate(<myvalidationgroup>) functions to different places in the page life cycle before the button handler runs, and in various 'If Page.IsPostBack' clauses, but this also is not useful. The problem of the initial validation failure remains consistent.
I am wondering if you could advise me about the best way of resolving this issue, as I believe I have now spent more time than is reasonable (several days) trying to resolve the problem. For example, can you me of any workaround for my scenario that would ensure that the radCaptcha control and the httphandler would be ready to perform the correct validation behaviour on the first attempt?
Thankyou for your advice on the problem.
Regards
Paul
Please could you advise if there is a workaround for my scenario, which is causing inconsistent validation behaviour in the radCaptcha control.
I have an ASCX user control in which a radCaptcha is added DECLARATIVELY in the ASCX markup. I use the <captchacontrol_id>.Validate and Page.Validate(<myvalidationgroup>) functions in my server-side button handler. On the user's first attempt to use the page to postback with validation, the IsValid property switches incorrectly to False as a result of running these functions, even if the captcha code is entered correctly. However, if the user tries again, the validation is successful, with the expected IsValid value of False being shown.
I do not believe this is directly a problem with my code, because this behaviour is only seen in the situation when the HttpRuntime process has to start up to serve the page. If the process is already running from previous requests, the 'first attempt failure' problem I describe above does not occur. It is as though the httphandler in Telerik.Web.UI.WebResource.axd is not ready until after the first postback. I have tried using the HttpHandlerUrl property to see if this serves to 'preload' the httphandler, but this does not seem to make any difference, e.g.:
myCaptchaId.HttpHandlerUrl = "~/Telerik.Web.UI.WebResource.axd"
I have also tried moving the <captchacontrol_id>.Validate and/or Page.Validate(<myvalidationgroup>) functions to different places in the page life cycle before the button handler runs, and in various 'If Page.IsPostBack' clauses, but this also is not useful. The problem of the initial validation failure remains consistent.
I am wondering if you could advise me about the best way of resolving this issue, as I believe I have now spent more time than is reasonable (several days) trying to resolve the problem. For example, can you me of any workaround for my scenario that would ensure that the radCaptcha control and the httphandler would be ready to perform the correct validation behaviour on the first attempt?
Thankyou for your advice on the problem.
Regards
Paul