Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Button / Embedded Icons

Change Button Type:
rbAdd
rbRemove
rbOk
rbCancel
rbUpload
rbDownload
rbPrevious
rbNext
rbOpen
rbAttach
rbSave
rbConfig
rbPrint
rbRefresh
rbSearch
rbHelp
rbCart
rbEdit
rbRSS
rbMail
rbFB
rbTwitter

  • RadButton offers a predefined set of built-in icons which the developer can use to decorate the control. Just set the PrimaryIconCssClass and/or SecondaryIconCssClass properties to one of the classes shown below and the control will display the respective icon. For example, setting PrimaryIconCssClass='rbOk' will render the embedded OK icon on the left side of the button control.

Source Code

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

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!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">
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <link href="rbPredefinedIcons.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            .predIcons
            {
                font-family: "Segoe UI" ,Arial,Helvetica,sans-serif;
                font-size: 12px;
                border-collapse: collapse;
                margin: 0 auto;
                color: #000;
            }
            .predIcons td
            {
                padding: 6px 6px 6px 10px;
                border: 1px solid #ddd;
            }
            .predIcons tr
            {
                background-color: #fff;
            }
            .predIcons tr.dark
            {
                background-color: #efefef;
            }
            .predIcons tr:hover
            {
                background-color: #FDFEE3;
            }
            .predIcons tr.head
            {
                border: 0;
                background: transparent;
            }
            .predIcons tr.head:hover
            {
                background: none;
            }
            .predIcons tr.head td
            {
                border: 0;
            }
            .rbPredefinedIcons
            {
                display: block;
                float: left;
                width: 16px;
                height: 16px;
                background-image: url(img/rbPredefinedIcons.png);
            }
            .text
            {
                display: block;
                width: 100px;
                float: right;
                text-align: left;
                padding-right: 15px;
            }
            .predIcons .rborder
            {
                border-right: 3px solid #ddd;
                padding-right: 10px;
            }
        </style>
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        
        <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Enabled="true" Title="Change Button Type:"
                            Expanded="true" Style="text-align: left; margin: auto;" HorizontalAlign="Right" Width="700px">
    <asp:RadioButtonList OnSelectedIndexChanged="ChangeButtonType_SelectedIndexChanged"
    RepeatDirection="Horizontal"
    ID="rblChangeButtonType" runat="server" AutoPostBack="True">

                    <asp:ListItem Value="StandardButton" Selected="True">Standard Button</asp:ListItem>
                    <asp:ListItem Value="LinkButton">Link Button</asp:ListItem>
                </asp:RadioButtonList>
        </qsf:ConfiguratorPanel>
        <asp:Panel ID="Panel1" runat="server">
        <table cellpadding="0" cellspacing="0" border="0" class="predIcons">
            <thead>
                <tr>
                    <td style="width: 150px;">
                        <label>
                            <strong>Button Icon and Class</strong>
                        </label>
                    </td>
                    <td style="width: 200px;">
                        <label>
                            <strong>Primary Icon</strong></label>
                    </td>
                    <td style="width: 200px;">
                        <label>
                            <strong>Secondary Icon</strong></label>
                    </td>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="rborder">
                        <span class="rbAdd16 rbPredefinedIcons"></span><span class="text">rbAdd</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton1" runat="server" Text="Add">
                            <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton2" runat="server" Text="Add">
                            <Icon SecondaryIconCssClass="rbAdd" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbRemove16 rbPredefinedIcons"></span><span class="text">rbRemove</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton3" runat="server" Text="Remove">
                            <Icon PrimaryIconCssClass="rbRemove" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton4" runat="server" Text="Remove">
                            <Icon SecondaryIconCssClass="rbRemove" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbOk16 rbPredefinedIcons"></span><span class="text">rbOk</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton5" runat="server" Text="OK">
                            <Icon PrimaryIconCssClass="rbOk" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton6" runat="server" Text="OK">
                            <Icon SecondaryIconCssClass="rbOk" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbCancel16 rbPredefinedIcons"></span><span class="text">rbCancel</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton7" runat="server" Text="Cancel">
                            <Icon PrimaryIconCssClass="rbCancel" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton8" runat="server" Text="Cancel">
                            <Icon SecondaryIconCssClass="rbCancel" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbUpload16 rbPredefinedIcons"></span><span class="text">rbUpload</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton9" runat="server" Text="Upload">
                            <Icon PrimaryIconCssClass="rbUpload" PrimaryIconLeft="4" PrimaryIconTop="4"/>
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton10" runat="server" Text="Upload">
                            <Icon SecondaryIconCssClass="rbUpload" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbDownload16 rbPredefinedIcons"></span><span class="text">rbDownload</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton11" runat="server" Text="Download">
                            <Icon PrimaryIconCssClass="rbDownload" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton12" runat="server" Text="Download">
                            <Icon SecondaryIconCssClass="rbDownload" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbPrevious16 rbPredefinedIcons"></span><span class="text">rbPrevious</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton13" runat="server" Text="Previous">
                            <Icon PrimaryIconCssClass="rbPrevious" PrimaryIconLeft="4" PrimaryIconTop="6" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton14" runat="server" Text="Previous">
                            <Icon SecondaryIconCssClass="rbPrevious" SecondaryIconRight="4" SecondaryIconTop="6" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbNext16 rbPredefinedIcons"></span><span class="text">rbNext</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton15" runat="server" Text="Next">
                            <Icon PrimaryIconCssClass="rbNext" PrimaryIconLeft="4" PrimaryIconTop="6" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton16" runat="server" Text="Next">
                            <Icon SecondaryIconCssClass="rbNext" SecondaryIconRight="4" SecondaryIconTop="6" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbOpen16 rbPredefinedIcons"></span><span class="text">rbOpen</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton17" runat="server" Text="Open">
                            <Icon PrimaryIconCssClass="rbOpen" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton18" runat="server" Text="Open">
                            <Icon SecondaryIconCssClass="rbOpen" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbAttach16 rbPredefinedIcons"></span><span class="text">rbAttach</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton19" runat="server" Text="Attach">
                            <Icon PrimaryIconCssClass="rbAttach" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton20" runat="server" Text="Attach">
                            <Icon SecondaryIconCssClass="rbAttach" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbSave16 rbPredefinedIcons"></span><span class="text">rbSave</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton21" runat="server" Text="Save">
                            <Icon PrimaryIconCssClass="rbSave" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton22" runat="server" Text="Save">
                            <Icon SecondaryIconCssClass="rbSave" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbConfig16 rbPredefinedIcons"></span><span class="text">rbConfig</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton23" runat="server" Text="Config">
                            <Icon PrimaryIconCssClass="rbConfig" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton24" runat="server" Text="Config">
                            <Icon SecondaryIconCssClass="rbConfig" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbPrint16 rbPredefinedIcons"></span><span class="text">rbPrint</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton25" runat="server" Text="Print">
                            <Icon PrimaryIconCssClass="rbPrint" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton26" runat="server" Text="Print">
                            <Icon SecondaryIconCssClass="rbPrint" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbRefresh16 rbPredefinedIcons"></span><span class="text">rbRefresh</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton27" runat="server" Text="Refresh">
                            <Icon PrimaryIconCssClass="rbRefresh" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton28" runat="server" Text="Refresh">
                            <Icon SecondaryIconCssClass="rbRefresh" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbSearch16 rbPredefinedIcons"></span><span class="text">rbSearch</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton29" runat="server" Text="Search">
                            <Icon PrimaryIconCssClass="rbSearch" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton30" runat="server" Text="Search">
                            <Icon SecondaryIconCssClass="rbSearch" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbHelp16 rbPredefinedIcons"></span><span class="text">rbHelp</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton31" runat="server" Text="Help">
                            <Icon PrimaryIconCssClass="rbHelp" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton32" runat="server" Text="Help">
                            <Icon SecondaryIconCssClass="rbHelp" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbCart16 rbPredefinedIcons"></span><span class="text">rbCart</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton33" runat="server" Text="Shopping Cart">
                            <Icon PrimaryIconCssClass="rbCart" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton34" runat="server" Text="Shopping Cart">
                            <Icon SecondaryIconCssClass="rbCart" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbEdit16 rbPredefinedIcons"></span><span class="text">rbEdit</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton35" runat="server" Text="Edit">
                            <Icon PrimaryIconCssClass="rbEdit" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton36" runat="server" Text="Edit">
                            <Icon SecondaryIconCssClass="rbEdit" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbRSS16 rbPredefinedIcons"></span><span class="text">rbRSS</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton37" runat="server" Text="RSS Feed">
                            <Icon PrimaryIconCssClass="rbRSS" PrimaryIconLeft="4" PrimaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton38" runat="server" Text="RSS Feed">
                            <Icon SecondaryIconCssClass="rbRSS" SecondaryIconRight="4" SecondaryIconTop="4" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbMail16 rbPredefinedIcons"></span><span class="text">rbMail</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton39" runat="server" Text="Mail">
                            <Icon PrimaryIconCssClass="rbMail" PrimaryIconLeft="4" PrimaryIconTop="6" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton40" runat="server" Text="Mail">
                            <Icon SecondaryIconCssClass="rbMail" SecondaryIconRight="4" SecondaryIconTop="6" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td class="rborder">
                        <span class="rbFB16 rbPredefinedIcons"></span><span class="text">rbFB</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton41" runat="server" Text="FaceBook">
                            <Icon PrimaryIconCssClass="rbFB" PrimaryIconLeft="4" PrimaryIconTop="3" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton42" runat="server" Text="FaceBook">
                            <Icon SecondaryIconCssClass="rbFB" SecondaryIconRight="4" SecondaryIconTop="3" />
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr class="dark">
                    <td class="rborder">
                        <span class="rbTwitter16 rbPredefinedIcons"></span><span class="text">rbTwitter</span>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton43" runat="server" Text="Twitter">
                            <Icon PrimaryIconCssClass="rbTwitter" PrimaryIconLeft="4" PrimaryIconTop="3" />
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton44" runat="server" Text="Twitter">
                            <Icon SecondaryIconCssClass="rbTwitter" SecondaryIconRight="4" SecondaryIconTop="3" />
                        </telerik:RadButton>
                    </td>
                </tr>
            </tbody>
        </table>
        </asp:Panel>
        <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451