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

Setting values dynamically

1 Answer 64 Views
SocialShare
This is a migrated thread and some comments may be shown as answers.
JS
Top achievements
Rank 1
JS asked on 21 Jun 2012, 07:03 PM
Hi there,

I'm using SocialShare and I'm setting the Title and the URL to share in the Page_Init event of my page. However, the tweet-button does not get the values from the SocialShare control. When I set them explicitly, the button gets the correct values. I also tried it in the Page_Load event, also without any result.

Setting the values dynamically for the Facebook Like Button works perfectly.

I also tried setting the Title and the URL from codebehind by looping through the mainbuttons. This did not work either.

Does someone have an idea how I can solve this?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Jun 2012, 12:41 PM
Hi,

In case you are using the Standard Twitter button please keep in mind that its original implementation from twitter  has issues with querystrings, so this may be causing the problem in your case. Could you try using the HttpUtility.UrlEncode() method before setting the URL for the twitter button and see if this helps?
tb.UrlToShare = HttpUtility.UrlEncode(url); //tb is a reference to the TwitterButton

This will confuse their engine and it will miss the query string.

Another alternative is to use the styled twitter button instead:
<telerik:RadSocialButton SocialNetType="ShareOnTwitter" TitleToShare=" " />


Kind regards,
Marin Bratanov
the Telerik team
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 their blog feed now.
Tags
SocialShare
Asked by
JS
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or