This is a migrated thread and some comments may be shown as answers.

CustomCharset

7 Answers 97 Views
Captcha
This is a migrated thread and some comments may be shown as answers.
Rakesh
Top achievements
Rank 1
Rakesh asked on 29 Jun 2015, 03:01 PM

Hi

I configured my captcha to have a custom character set to include the characters "abcdefghjkmnopqrstuvwxyz23456789". Basically removed L,l,i,I,0. but sometimes it is showing these removed characters in the captcha text. I tried this on your demo page (http://demos.telerik.com/aspnet-ajax/captcha/examples/characterset/defaultcs.aspx) and I saw the demo is also showing these characters. Attached are the screen shots.

Here is my configuration

HTML code:

<telerik:RadCaptcha ID="RadCaptcha1" Skin="Transparent" runat="server" EnableRefreshImage="True" Display="Static" ValidationGroup="vgAudio" ErrorMessage=" " meta:resourcekey="RadCaptcha1Resource1" ImageStorageLocation="Cache" CaptchaImage-EnableCaptchaAudio="true" CaptchaTextBoxLabel=" " CaptchaImage-ImageAlternativeText="Type the code from the image." CaptchaImage-FontWarp="Medium" CaptchaImage-BackgroundNoise="Medium" CaptchaImage-LineNoise="Medium" CaptchaImage-TextLength="6" CaptchaImage-UseRandomFont="False" RefreshImageAccessKey="J" CaptchaImage-TextChars="CustomCharSet" IgnoreCase="True" CaptchaImage-PersistCodeDuringAjax="true"></telerik:RadCaptcha>

Server Code:

radCaptcha.CaptchaImage.CharSet = "AaBbCcDdEeFfGgHhJjKkMmNnPpQqRrSsTtUuVvWwXxYyZz23456789";

Please let me know if I am missing something.

Any help is really appreciated and Thanks

Rakesh

 

7 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 01 Jul 2015, 04:03 PM
Hi Rakesh,

Thank you for contacting us.

I tested the described scenario fully but was able to reproduce it only in our online demos, when the "Generate New Image" is clicked too soon after the "Set" button of the configurator. If this is the scenario followed by you, the reason for this issue is that clicking over the "Generate New Image" button cancels the ajax requesting updating the Captcha with the passed character set, resulting in not applied custom character set at all.

Testing it on a separate project, though, when the custom character set were applied on the server, I was not able to reproduce the reported problem. I am attaching my test page to this rely so you can examine it on your side and see whether it differs somehow from your own configuration.

Looking forward to receiving a reply from you,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 01 Jul 2015, 04:37 PM

Hi Vessy

Thank you for the reply

I am still able to reproduce this issue in my project. here is my piece of code. Please let me know your suggestions on how to resolve this issue.
​

 protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
              
                ConfigCaptcha(ref radCaptcha);
            }  
            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Page.Response.Cache.SetNoStore();
        }

protected void ConfigCaptcha(ref RadCaptcha radCaptcha)
        {         
                radCaptcha.CaptchaImage.CharSet = "AaBbCcDdEeFfGgHhJjKkMmNnPpQqRrSsTtUuVvWwXxYyZz23456789";
          
        }

 

Thank you

Rakesh

0
Vessy
Telerik team
answered on 02 Jul 2015, 02:29 PM
Hi Rakesh,

I tested the Captcha with the provided server-side configuration, but still was not able to reproduce the reported error with it. I am attaching a short video, demonstrating part of my tests - can you look and it and see whether I am not leaving anything out?

Can you please provide some more details on the exact scenario in which the issue occurs?
  • Are you observing this behavior only in a specific browser and its version?
  • Which version of the controls is used in your application?

I am also attaching my modified test page - can you test it and see whether you are experiencing the problem with it? I made my tests in IE, using the latest version of the controls (2015.2.623).

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rakesh
Top achievements
Rank 1
answered on 02 Jul 2015, 02:45 PM

Hi Vessy
I know this is tough to reproduce. Initially on pageload it is generating the correct captcha but on multiple postbacks or multiple clicks on "Generate New Image" I am seeing this issue.
I am using IE 10 and Telerik version is 2014.3.1024.35.

Again this is not consistent. This happens once in 100 times but it is happening.

In your sample I see that the captcha is configured on pre_render event.and I am not able to reproduce on your test page.
I am configuring captcha only once initially(see previous reply code) on page_load().May be should I configure captcha on every postback like below? Do you think this makes any difference?

 protected virtual void Page_Load(object sender, EventArgs e)
         {   
             ConfigCaptcha(ref radCaptcha);             
             Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
             Page.Response.Cache.SetNoStore();
         }

protected void ConfigCaptcha(ref RadCaptcha radCaptcha)
         {         
                 radCaptcha.CaptchaImage.CharSet = "AaBbCcDdEeFfGgHhJjKkMmNnPpQqRrSsTtUuVvWwXxYyZz23456789";
           
         }

Thanks
Rakesh

 

 

0
SANJAY
Top achievements
Rank 1
answered on 06 Jul 2015, 04:43 AM

Hi Rakesh

Recently I noticed a bug or a problem in my application which was related to the fact that IsPostBack was not functioning as it is supposed. On the post back raised by Telerik RadGrid, the VB.net application did not register a post back. It would be nice if you could check from that angle

 

Regards     

0
Vessy
Telerik team
answered on 07 Jul 2015, 10:27 AM
Hi Rekesh,

Configuring the Captcha in Page_PreRender was just a part my attempts to reproduce the issue and is not mandatory for the Captcha configuration. Nevertheless, you can probably use it as a workaround of the issue as the Captcha is behaving as expected when its custom char set is configured in the Page_PreRender event.

On a side note, I understand that the issue is not consistent and made several more tests in IE10, using the mentioned by you version of the controls, but still was not able to reproduce the problem. Did you have the chance to test the Sanjay;s suggestion and see whether this is not the case on your side?

I am afraid that I am not able to be of much more help unless I am able to reproduce and examine the problem on my side. Should you deem anything else as a possible hindrance that we might have missed so far, do not hesitate to inform us, so that we can investigate it further.

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
SANJAY
Top achievements
Rank 1
answered on 08 Jul 2015, 07:00 AM

Hi Rakesh

 

I have written a small routine for post back

 

If httpcontext.current.request.url.tostring.trim = httpcontext.current.request.referrerurl.tostring.trim then

        postback = true

end if

 

Regards

Tags
Captcha
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Rakesh
Top achievements
Rank 1
SANJAY
Top achievements
Rank 1
Share this question
or