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

FormDecorator / Partial Page Decoration

Decorating specific parts of the page

Zone Decorated with Office2007 Skin


Zone Decorated with Web20 Skin


Non-decorated Zone




  • Decorating parts of the page

    By using DecorationZoneID property, only certain parts of a web page can be decorated. The following example demonstrates how to decorate only portions of the page, and not the whole page. The property value should be the client side ID of an HTML element. The example uses two decoration zones - one decorated with Office2007 skin and the other - with Web20. In addition, outside of the zones there exist buttons and checkboxes that are not decorated.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.Web.Examples.FormDecorator.DecorationZoneID.DefaultCS" %>
    <%@ 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 runat="server" ID="Headtag1"></qsf:HeadTag>
        <style type="text/css">
        fieldset
        {
          border: solid 1px #ccc;
          margin: 8px;
        }
        
        legend
        {
            background: white;
            padding: 0 4px;
        }
        
        br
        {
            clear: both;
        }
        .qsfSkinChooser img
        {
            margin-top: -1px;
        }
        </style>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
          <qsf:header id="Header1" runat="server" navigationlanguage="c#" ShowSkinChooser="false"/>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <qsf:InformationBox ID="InformationBox1" runat="server" Title="Decorating specific parts of the page" ></qsf:InformationBox>
            <telerik:radformdecorator id="RadFormDecorator1" DecoratedControls="all" runat="server" decorationzoneid="ZoneID1"
                skin="Office2007">
            </telerik:radformdecorator>
            <telerik:radformdecorator id="RadFormDecorator2" DecoratedControls="all" runat="server" decorationzoneid="ZoneID2"
                skin="Web20">
            </telerik:radformdecorator>
            <div>
                <div id="ZoneID1" style="float: left; margin: 0 10px;">
                    <fieldset style="width:230px">
                        <legend>Zone Decorated with Office2007 Skin</legend>
                        <asp:CheckBoxList runat="server" Width="200px">
                            <asp:ListItem Text="CheckBox 1"></asp:ListItem>
                            <asp:ListItem Text="CheckBox 2"></asp:ListItem>
                            <asp:ListItem Text="CheckBox 3"></asp:ListItem>
                        </asp:CheckBoxList>
                        <br />
                        <asp:RadioButtonList runat="server" Width="200px">
                            <asp:ListItem Text="RadioButton 1"></asp:ListItem>
                            <asp:ListItem Text="RadioButton 2"></asp:ListItem>
                            <asp:ListItem Text="RadioButton 3"></asp:ListItem>
                        </asp:RadioButtonList>
                        <br />
                        <asp:Button Text="Do Postback" runat="server" Width="85px" />
                    </fieldset>
                </div>
                <div id="ZoneID2" style="float: left; margin: 0 10px;">
                    <fieldset style="width:230px">
                        <legend>Zone Decorated with Web20 Skin</legend>
                        <asp:CheckBoxList ID="CheckBoxList1" Width="200px" runat="server">
                            <asp:ListItem Text="CheckBox 1"></asp:ListItem>
                            <asp:ListItem Text="CheckBox 2"></asp:ListItem>
                            <asp:ListItem Text="CheckBox 3"></asp:ListItem>
                        </asp:CheckBoxList>
                        <br />
                        <asp:RadioButtonList ID="RadioButtonList1" Width="200px" runat="server">
                            <asp:ListItem Text="RadioButton 1"></asp:ListItem>
                            <asp:ListItem Text="RadioButton 2"></asp:ListItem>
                            <asp:ListItem Text="RadioButton 3"></asp:ListItem>
                        </asp:RadioButtonList>
                        <br />
                        <asp:Button ID="Button1" Text="Do Postback" Width="85px" runat="server" />
                    </fieldset>
                </div>
                <div id="ZoneID3" style="float: left; margin: 0 10px;">
                    <fieldset style="width:230px">
                        <legend>Non-decorated Zone</legend>
                        <asp:CheckBoxList ID="CheckBoxList2" runat="server">
                            <asp:ListItem Text="CheckBox 1"></asp:ListItem>
                            <asp:ListItem Text="CheckBox 2"></asp:ListItem>
                            <asp:ListItem Text="CheckBox 3"></asp:ListItem>
                        </asp:CheckBoxList>
                        <br />
                        <asp:RadioButtonList ID="RadioButtonList2" runat="server">
                            <asp:ListItem Text="RadioButton 1"></asp:ListItem>
                            <asp:ListItem Text="RadioButton 2"></asp:ListItem>
                            <asp:ListItem Text="RadioButton 3"></asp:ListItem>
                        </asp:RadioButtonList>
                        <br />
                        <asp:Button ID="Button2" Text="Do Postback" runat="server" />
                    </fieldset>
                </div>
                <br />
            </div>
             <qsf:footer runat="server" id="Footer1"/>
        </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