Client-side API: setting title/url gets URL encoded

2 posts, 0 answers
  1. Adam
    Adam avatar
    2 posts
    Member since:
    Mar 2014

    Posted 10 Apr 2014 Link to this post

    When I use the client side API to set the title and URL of my page to be shared, my page title gets URL encoded:

    1.function OnSocialButtonClicking(sender, args) {
    2.var url =  "http://www.telerik.com/"
    3.var title = "test test test test test test"
    4.args.set_stringsToShare(url, title)
    5.}


    the tweet message comes out URL encoded: "test%20test%20test%20test%20test%20test"

    is there a way around this? It happens on pinterest, facebook too
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 15 Apr 2014 Link to this post

    Hi Adam,

    Setting the parameters to the sender, seems to fixes the issue on my side. For example:
    JavaScript:
    <script>
        function OnSocialButtonClicking(sender, args) {
            var url = "http://www.telerik.com/";
            var title = "test test test test test test";
            sender.set_stringsToShare(url, title);
        }
    </script>
    ASPX:
    <telerik:RadSocialShare ID="RadSocialShare1" runat="server" OnSocialButtonClicking="OnSocialButtonClicking">
        <MainButtons>
            <telerik:RadSocialButton SocialNetType="ShareOnTwitter" TitleToShare="my title" UrlToShare="http://www.google.com" />
        </MainButtons>
    </telerik:RadSocialShare>



    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top