New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Server-Side API

  • Demo Configurator

Choose the MainButtons

Choose Orientation

Use LabelText

Set UrlToShare

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.

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.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.Web.Examples.SocialShare.ServerSideAPI.DefaultVB" %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-containers">
    <div class="demo-container">
        <asp:UpdatePanel ID="Updatepanel1" runat="server" UpdateMode="Conditional">
                <div class="shareWrapper">
                    <telerik:RadSocialShare RenderMode="Lightweight" runat="server" ID="RadSocialShare1" UrlToShare=""
                        TitleToShare="ASP.NET AJAX Controls, .NET Web UI Components | Telerik">

    <qsf:ConfiguratorPanel runat="server">
                <qsf:ConfiguratorColumn runat="server" Size="Medium">
                    <h4>Choose the MainButtons</h4>
                    <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">
                <qsf:ConfiguratorColumn runat="server" Size="Narrow">
                    <h4>Choose Orientation</h4>
                    <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>
                <qsf:ConfiguratorColumn runat="server" Size="Narrow">
                    <h4>Use LabelText</h4>
                    <asp:CheckBox ID="ShowLabelsCheckbox" Text="Show text next to the buttons" runat="server" Width="205"></asp:CheckBox>
                    <div class="instructionTitle">
                        Set UrlToShare
                    <br />
                    <qsf:TextBox ID="UrlTextbox" runat="server" Width="300px" Text=""></qsf:TextBox>
                    <br />
                    <br />
                    <qsf:Button ID="ConfigureButton_Click" Text="Configure SocialShare" OnClick="Configure_Click"

Support & Learning Resources

Find Assistance