SocialShare

Controls

All Controls

SocialShare

Rate this demo

Thank you for your post!
Submit a support ticket
If you have an active license or trial, you have access to dedicated support from Telerik’s developers. Response time is 24h for active licenses and 72h for trials, Mon-Fri.
Post in the forums
If you don’t have access to support or would like to help other people by sharing your problem, reach out to our active community in the forums.

SocialShare - Server-Side API

This RadSocialShare has only one button defined - the CompactButton button. A click will open the popup with the rest. You can choose which of the buttons to have on the page initially via the checkboxes in the configurator.
Configure SocialShare
Choose the MainButtons




Choose Orientation

Use LabelText
Set UrlToShare



Server-side Programming

The RadSocialShare is primarily a user interaction control and does not offer any specific server-side functionality. You can, however, programmatically create the Button Collections depending on some logic. In this example checkboxes are used, yet you can store a user's preferences in a file and read the information from it. For example, when a user registers on the site he/she can provide a list of networks that he/she wishes to connect to and the RadSocialShare can be configured to acknowledge these preferences.

Note that controls should be created early in the page lifecycle in order to be persisted across postbacks. This is why they are created in the Page Load event in this demo and not in the button click event, as Page Load is the earliest point in which you can check the state of a checkbox. Ultimately control creation should be done in the Page Init event or re-done by the developer after each postback if done in the button click event.

C# VB
Show code in new window Demo isolation steps
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.SocialShare.ServerSideAPI.DefaultCS" %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>ASP.NET SocialShare Demo - Server-Side API</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <qsf:InformationBox ID="InformationBox2" runat="server">
        <span>This <strong>RadSocialShare</strong> has only one button defined - the <strong>
            CompactButton</strong> button. A click will open the popup with the rest. You can
            choose which of the buttons to have on the page initially via the checkboxes in
            the configurator. </span>
    </qsf:InformationBox>
    <asp:UpdatePanel ID="Updatepanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="shareWrapper">
                <telerik:RadSocialShare runat="server" ID="RadSocialShare1" UrlToShare="http://www.telerik.com/products/aspnet-ajax.aspx"
                    TitleToShare="ASP.NET AJAX Controls, .NET Web UI Components | Telerik">
                    <MainButtons>
                        <telerik:RadCompactButton></telerik:RadCompactButton>
                    </MainButtons>
                    <CompactButtons>
                    </CompactButtons>
                </telerik:RadSocialShare>
            </div>
            <div class="configuratorWrapper">
                <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configure SocialShare"
                    Expanded="true">
                    <div class="instructionTitle">
                        Choose the MainButtons</div>
                    <asp:CheckBoxList ID="ButtonsCheckBoxList" runat="server" AutoPostBack="false" RepeatColumns="3">
                        <asp:ListItem Text="ShareOnTwitter" Value="ShareOnTwitter">
                        </asp:ListItem>
                        <asp:ListItem Text="LinkedIn" Value="LinkedIn">
                        </asp:ListItem>
                        <asp:ListItem Text="Delicious" Value="Delicious">
                        </asp:ListItem>
                        <asp:ListItem Text="Blogger" Value="Blogger">
                        </asp:ListItem>
                        <asp:ListItem Text="Digg" Value="Digg">
                        </asp:ListItem>
                        <asp:ListItem Text="Reddit" Value="Reddit">
                        </asp:ListItem>
                        <asp:ListItem Text="StumbleUpon" Value="StumbleUpon">
                        </asp:ListItem>
                        <asp:ListItem Text="MySpace" Value="MySpace">
                        </asp:ListItem>
                        <asp:ListItem Text="Tumblr" Value="Tumblr">
                        </asp:ListItem>
                        <asp:ListItem Text="ShareOnFacebook" Value="ShareOnFacebook">
                        </asp:ListItem>
                        <asp:ListItem Text="ShareOnYammer" Value="ShareOnYammer">
                        </asp:ListItem>
                        <asp:ListItem Text="ShareOnPinterest" Value="ShareOnPinterest">
                        </asp:ListItem>
                        <asp:ListItem Text="GoogleBookmarks" Value="GoogleBookmarks">
                        </asp:ListItem>
                        <asp:ListItem Text="MailTo" Value="MailTo">
                        </asp:ListItem>
                        <asp:ListItem Text="SendEmail" Value="SendEmail">
                        </asp:ListItem>
                    </asp:CheckBoxList>
                    <div class="instructionTitle">
                        Choose Orientation</div>
                    <asp:RadioButtonList ID="OrientationRadioButtonList" runat="server" AutoPostBack="false">
                        <asp:ListItem Text="Horizontal" Selected="True" Value="Horizontal"></asp:ListItem>
                        <asp:ListItem Text="Vertical" Value="Vertical"></asp:ListItem>
                    </asp:RadioButtonList>
                    <div class="instructionTitle">
                        Use LabelText</div>
                    <asp:CheckBox ID="ShowLabelsCheckbox" Text="Show text next to the buttons" runat="server">
                    </asp:CheckBox>
                    <div class="instructionTitle">
                        Set UrlToShare</div>
                    <br />
                    <asp:TextBox ID="UrlTextbox" runat="server" Width="300px" Text="http://www.telerik.com/products/aspnet-ajax.aspx"></asp:TextBox>
                    <br />
                    <br />
                    <asp:Button ID="ConfigureButton_Click" Text="Configure SocialShare" OnClick="Configure_Click"
                        runat="server"></asp:Button>
                </qsf:ConfiguratorPanel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
Telerik UI for ASP.NET AJAX Q3'14 Release is here