All Controls


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.

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" "">
<html xmlns=''>
<head runat="server">
    <title>ASP.NET SocialShare Demo - Server-Side API</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
    <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>
    <asp:UpdatePanel ID="Updatepanel1" runat="server" UpdateMode="Conditional">
            <div class="shareWrapper">
                <telerik:RadSocialShare runat="server" ID="RadSocialShare1" UrlToShare=""
                    TitleToShare="ASP.NET AJAX Controls, .NET Web UI Components | Telerik">
            <div class="configuratorWrapper">
                <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configure SocialShare"
                    <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 Text="LinkedIn" Value="LinkedIn">
                        <asp:ListItem Text="Delicious" Value="Delicious">
                        <asp:ListItem Text="Blogger" Value="Blogger">
                        <asp:ListItem Text="Digg" Value="Digg">
                        <asp:ListItem Text="Reddit" Value="Reddit">
                        <asp:ListItem Text="StumbleUpon" Value="StumbleUpon">
                        <asp:ListItem Text="MySpace" Value="MySpace">
                        <asp:ListItem Text="Tumblr" Value="Tumblr">
                        <asp:ListItem Text="ShareOnFacebook" Value="ShareOnFacebook">
                        <asp:ListItem Text="ShareOnYammer" Value="ShareOnYammer">
                        <asp:ListItem Text="ShareOnPinterest" Value="ShareOnPinterest">
                        <asp:ListItem Text="GoogleBookmarks" Value="GoogleBookmarks">
                              <asp:ListItem Text="ShareOnGooglePlus" Value="ShareOnGooglePlus">
                        <asp:ListItem Text="MailTo" Value="MailTo">
                        <asp:ListItem Text="SendEmail" Value="SendEmail">
                    <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>
                    <div class="instructionTitle">
                        Use LabelText</div>
                    <asp:CheckBox ID="ShowLabelsCheckbox" Text="Show text next to the buttons" runat="server">
                    <div class="instructionTitle">
                        Set UrlToShare</div>
                    <br />
                    <asp:TextBox ID="UrlTextbox" runat="server" Width="300px" Text=""></asp:TextBox>
                    <br />
                    <br />
                    <asp:Button ID="ConfigureButton_Click" Text="Configure SocialShare" OnClick="Configure_Click"