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

ShareThis Social Buttons Disappear on Ajaxing on TabStrip

3 Answers 134 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
harpreet
Top achievements
Rank 1
harpreet asked on 15 Mar 2012, 10:02 AM
Issue: Social buttons (ShareThis) show up initially on load but on ajaxing on Tab Strip the ShareThis buttons disappear. Spent many hours trying to figure this out and tried all the forum suggestions but nothing seems to work. Pls advise fix. Thx 

Here is sample code (stripped down)

<telerik:RadAjaxPanel runat="server" ID="rjpFeatureDeal" LoadingPanelID="RadAjaxLoadingPanel1"
    ClientEvents-OnRequestStart="conditionalPostback" >
       <div class="subrub1">
                        <telerik:RadTabStrip ID="rtsUserDeal" runat="server" OnTabClick="rtsUserDeal_TabClick" Skin="Black">
                              
                        </telerik:RadTabStrip>
       </div>

 <asp:Panel runat="server" ID="pnlsocial" Width="100%" Direction="LeftToRight">
                                                   
                                                    <div id="divShareThis" runat="server">
                                                        <asp:Label ID="lblPageCustomURL" runat="server" Visible="false"></asp:Label>
                                                        <asp:Label ID="lblPageCustomTitle" runat="server" Visible="false" Text=""></asp:Label>
                                                    </div>

                                               <div id="divShareThisScript" runat="server">
                                                    </div> 

             <div id="ShareThisSmall" class="clsShareThis" runat="server">
                                                        
                    <span class='st_twitter' st_url="<%=lblPageCustomURL.Text%>" st_title="<%=lblPageCustomTitle.Text %>"></span>
                     <span class='st_linkedin' st_url="<%=lblPageCustomURL.Text%>" st_title="<%=lblPageCustomTitle.Text %>"> </span>
                      <span class='st_email' st_url="<%=lblPageCustomURL.Text%>" st_title="<%=lblPageCustomTitle.Text %>"></span>
                      <span class='st_sharethis' st_url="<%=lblPageCustomURL.Text%>" st_title="<%=lblPageCustomTitle.Text %>"></span>
                                                          
            </div>

</asp:Panel>
</telerik:RadAjaxPanel >


<!----ShareThis codebehind script -->

   public static string BuildShareThisScript(string PublisherID)
   {
       //   <!--ShareThis script:-->
       //<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> 
       //  <script type="text/javascript"> 
       //   stLight.options({ 
       //           publisher:  'XXXXXXX',
       //   }); 
       //   </script> 

       string ShareThis = "<script type=\"text/javascript\" src=\"http://w.sharethis.com/button/buttons.js\"></script>";
       ShareThis += "<script type=\"text/javascript\">";
       ShareThis +=  "stLight.options({publisher:'" + PublisherID + "'});</script>";
       return ShareThis;

   }

 string scriptString = Social.BuildShareThisScript(ShareThisPublisherID);
  divShareThisScript.InnerHtml = scriptString;
                        


3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 19 Mar 2012, 10:59 PM
Hi Harry,

Can you specify which are Social buttons (ShareThis) that show up on initial load? From the provided code I can only see three divs which contains ShareThis in their ids.

Greetings,
Pavlina
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.
0
harpreet
Top achievements
Rank 1
answered on 21 Mar 2012, 10:49 PM
Hi Pavlina,

  I have attached 2 images to demonstrate the issues
     1) Social Button State on Initial Load: Here we have multiple social buttons. 
                a) FB Like & Send: Using direct FB Code
                b) Google+, PinInterest, Twitter Follow: Using direct integration code from each of these sites
                c) ShareThis Buttons:FB, Twitter, LinkedIn, Mail, ShareThis other social sites button (green button)

   2) Social Button State After Ajax Call on Telerik TabClick Event

   Only FB Like & Send direct site buttons (1a) don't mess up on Ajax postback. Rest of the buttons either dissappear or mess up totally.

  This is really a critical issue and will appreciate a quick fix.

Thx,
Harry
0
Pavlina
Telerik team
answered on 26 Mar 2012, 10:20 PM
Hi Harry,

I am afraid that the provided information is not enough to determine what is causing the described problem. It seems that the issue is somewhere in your custom implementation. Therefore it will be best if you open a formal support ticket and send us stripped runnable version of your application. Thus we will be able to test it locally and advise you further.

Kind regards,
Pavlina
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
Ajax
Asked by
harpreet
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
harpreet
Top achievements
Rank 1
Share this question
or