ToolBar - Render Modes

Render mode comparison

Render Mode
Classic vs. Light rendering
Classic Lightweight
Markup Size 18.23 KB 19.65 KB
CSS Size 24.6 KB 9.7 KB
Image Sprite Size 7.7 KB 30.9 KB*
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

This demo showcases the two different rendering modes of Telerik's ASP.NET RadToolBar control: Classic and Lightweight.

  • Classic rendering is the long-standing rendering mode of the control.
  • Lightweight rendering leverages HTM5 and CSS3, but the control may lose its rounded corners, gradients and shadows in non-modern browsers.

The default render mode of the control is Classic and you have the option to either explicitly set it to Lightweight or leverage the Auto mode to have the control choose the best rendering based on the user's browser.

Note: In order to provide optimal experience for your end users, we recommend that you use only one type of render mode for a control on a given page. For example, if you have two instances of RadFormDecorator on the page, it will be best if both of them use the same render mode.

Note: The Material skin is available only for the modern Lightweight render mode. Change the skin or the mode to properly visualize the demonstrated control.

Notes on the statistics:
The markup size is calculated automatically in the code-behind by rendering a simple RadToolBar instance on a blank page.
*The image sprite that causes the increase in size is a common one, used by various Telerik controls on the page, so with more controls the benefits will be more apparent.

  • DefaultCS.aspx
    • DefaultCS.aspx
    • ToolBarCS.aspx
  • DefaultCS.aspx.cs
    • DefaultCS.aspx.cs
    • ToolBarCS.aspx.cs
  • styles.css
<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="ToolBar.Examples.Functionality.RenderModes.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>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-medium">
        <iframe id="iframe1" allowTransparency="true" runat="server" src="" frameborder="0" style="width: 560px; height: 190px"></iframe>
    </div>


    <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Render mode comparison">
        <Views>
            <qsf:View>

                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Title="Render Mode" Size="Narrow">
                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" RepeatLayout="UnorderedList" CssClass="fb-group">
                        <asp:ListItem Value="Lightweight" Selected="True">Lightweight</asp:ListItem>
                        <asp:ListItem Value="Classic">Classic</asp:ListItem>
                    </asp:RadioButtonList>
                </qsf:ConfiguratorColumn>

                <qsf:ConfiguratorColumn ID="ConfiguratorColumn2" runat="server" Size="Wide" Title="Classic vs. Light rendering">
                    <table class="table" cellspacing="0">
                        <thead>
                            <tr>
                                <th></th>
                                <th>Classic</th>
                                <th>Lightweight</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <th>Markup Size</th>
                                <td>
                                    <asp:Label ID="ClassicSize" runat="server"></asp:Label></td>
                                <td>
                                    <asp:Label ID="LightweightSize" runat="server"></asp:Label></td>
                            </tr>
                            <tr>
                                <th>CSS Size</th>
                                <td>24.6 KB</td>
                                <td>9.7 KB</td>
                            </tr>
                            <tr>
                                <th>Image Sprite Size</th>
                                <td>7.7 KB</td>
                                <td>30.9 KB*</td>
                            </tr>
                        </tbody>
                    </table>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?