Edit this page

Render Modes

RadNotification has different render modes that can change the actual HTML markup that is rendered. They are exposed via the RenderMode property that can have four possible values - Classic, Lightweight, Mobile and Auto. This functionality was introduced in the Q2 2015 version.

The possible options are:

  • Classic—this mode is the rendering that has been used before. It remains without changes and it is the default value of the property. In this mode background images and icons (in several sprites) are used to create the appearance of the controls (gradients and icons). The HTML rendering is semantic and lightweight since its inception. CSS3 is used for rounded corners and shadows.

  • Lightweight—this mode emphasizes on semantic HTML and CSS3. It reduces the amount of markup the control renders and makes it easier to customize. This also reduces the number of image sprites required by the control. All of this decreases the overall size and complexity of each skin, including custom ones. The titlebar background, icons and command buttons are implemented via CSS (a gradient, and font-icons respectively).

  • Mobile—this mode is currently not supported. If you set it, the mode will fall back automatically to Lightweight.

  • Auto—this mode makes each control choose the appropriate rendering mode according to the used browser—Classic or Lightweight. This functionality was added in Q3 2013.

important

RadNotification, as well as the other Telerik controls that utilize render modes, supports only one type of render mode per page. This includes mode being set for a standalone instance(s), and a programmatically created instance(s). All such controls must have the same RenderMode on a given page.This also includes instances from user controls and master pages.

note

RadNotification uses RadContextMenu internally and it inherits the notification's RenderMode, so it brings its stylesheets to the page and that can affect other RadContextMenu and RadMenu instances. You can remove the built-in context menu by setting the Visible property of the NotificationMenu composite tag to false.

Setting Render Mode

There are two ways to configure the rendering mode of the controls:

  • The RenderMode property in the markup or in the code-behind that can be used for a particular instance:

    ASP.NET

    <telerik:RadNotification ID="RadNotification" runat="server" RenderMode="Lightweight">
    </telerik:RadNotification>
    

    C#

    RadNotification1.RenderMode = Telerik.Web.UI.RenderMode.Lightweight;
    

    VB

    RadNotification1.RenderMode = Telerik.Web.UI.RenderMode.Lightweight
    
  • A global setting in the web.config file that will affect the entire application, unless a concrete value is specified for a given control instance:

    XML

    <appSettings>
        <add key="Telerik.Web.UI.Notification.RenderMode" value="lightweight" />
    </appSettings>
    

See Also