How to disable Audio Code option on SocialShare SendEmail

4 posts, 0 answers
  1. Glenn
    Glenn avatar
    47 posts
    Member since:
    Nov 2011

    Posted 19 Nov 2013 Link to this post

    Have deployed a website to Azure websites and one of the pages has a SocialShare Send Email button.  The popup send email form includes the Radcaptcha and by default has the "Get Audio Code" option.







    When visiting the page I get a message "This web page wants to run the following add-on: 'Windows Media Player"  It took me awhile to figure out why and than noticed that the popup form generated from SocialShare SendEmail has the Audio code option.



    So when debugging the page (on the basis that a user chooses not to select the Allow) when proceeding to redirect the page I get error:  "An unhandled exception of type 'System.NullReferenceException' occurred in System.Speech.dll"



    (note I don't get this error when running local). 







    I am assuming this is being caused by the SocialShare Radcaptcha needing the add-on and errors out without it.



    In any case I am happy to disable the AudioCode option as I have also done this on another Radcaptcha on the same page.







    Is there a way to disable the Audiocode option on SocialShare Send Email button?







    Thanks











  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 25 Nov 2013 Link to this post

    Hello Glenn,

    In order for the RadCaptcha that is embedded in the RadSocialShare to play its audio in Internet Explorer an additional add-on is required (e.g. Windows Media Player). That is the reason for the occurrence of the mentioned message. This message, however, is not displayed in other major browsers because they can play audio out of the box.

    As for the error message related to the System.Speech.dll file, this issue has already been fixed in Q3 2013 SP1 - version 2013.3.1114. Could you please try to upgrade RadControls to this version and then tell us whether the issue is fixed?

    On a side note - you can disable the captcha audio as follows:
    protected void Page_Load(object sender, EventArgs e)
    {
        ((RadSocialShare1.FindControl(RadSocialShare1.ID + "_emailPopup") as RadWindow).ContentContainer.Controls[0].FindControl(RadSocialShare1.ID + "_captcha") as RadCaptcha).CaptchaImage.EnableCaptchaAudio = false;
    }

    This traverses the control tree of the RadSocialShare to find the e-mail popup and then the RadCaptcha inside and disable its audio.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Glenn
    Glenn avatar
    47 posts
    Member since:
    Nov 2011

    Posted 25 Nov 2013 Link to this post

    Yes after my original post I updated to latest version and that took care of the error message relating to the System.Speech.dll file.  However upon pressing the audio link using IE 11 I hear no sound, I also have not been prompted to whether I want allow the Windows Media Player add-on.  I can't see any Windows Media Player Add-on in the add-ons.  NOTE the audio works fine when using Firefox.


    In any case I have opted, for now, to disable the audio so as not to confuse IE users.  Your code didn't quite work with the Findcontrol not being able to retrieve the RadCaptcha of id: "RadSocialShare1_captcha".  Upon debugging I can see that the ID of the RadCaptcha is the same as the staticID which is in this case is "ct100_MainContent_RadSocialShare1_captcha", such is why find control is not finding it.



    I can manage to disable it using the following code:



    For Each ctrl As Control In TryCast(RadSocialShare1.FindControl(RadSocialShare1.ID + "_emailPopup"), RadWindow).ContentContainer.Controls(0).Controls

    If TypeOf ctrl Is RadCaptcha Then

    Dim captcha As RadCaptcha = TryCast(ctrl, RadCaptcha)

    captcha.CaptchaImage.EnableCaptchaAudio = False

    Exit For

    End If

    Next


    Unless you can recommend a more efficient way, I'll just go with that code.



    Thanks for your help. Greatly appreciated.





  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 28 Nov 2013 Link to this post

    Hello Glenn,

    There is an issue with the playing of the RadCaptcha's audio in IE11. The issue has been logged in our feedback portal here, so that you can monitor, comment and vote on it.

    As for the provided code sample I have tested it and it seems to be working on my side. You can watch a short video with the test in the attached archive and then tell me if I am missing something.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top