Source included Base class for EPiServer page templates that supports Save, on-page editing and right click administration.

Namespace:  EPiServer
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
public class TemplatePage : EditPage

Remarks

CopyC#
#region Copyright � 1997-2008 EPiServer AB. All Rights Reserved.
/*
This code may only be used according to the EPiServer License Agreement.
The use of this code outside the EPiServer environment, in whole or in
parts, is forbidden without prior written permission from EPiServer AB.

EPiServer is a registered trademark of EPiServer AB. For more information 
see http://www.episerver.com/license or request a copy of the EPiServer 
License Agreement by sending an email to info@episerver.com*/

#endregion

using System;
using EPiServer.Web.PageExtensions;

namespace EPiServer
{
    /// <summary>
    /// <img src="Icons/CSharp.gif" alt="Source included" border="0" /> 
    /// Base class for EPiServer page templates that supports Save, on-page editing and right click administration.
    /// </summary>
    /// <example>Example that adds a custom menu item to the right click menu
    /// <code lang="C#">
    /// protected void Page_Load(object sender, EventArgs e)
    ///    {
    ///        RightClickMenu.Items.Add( new RightClickMenuItem("test",null,null,"true",null,RightClickMode.All));
    ///    }
    ///    </code>
    /// </example>
    /// <remarks>
    /// <code source="../EPiServerNET/TemplatePage.cs" lang="cs"/>
    /// </remarks>
    public class TemplatePage : EditPage
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TemplatePage"/> class.
        /// </summary>
        public TemplatePage()
            : this(0, 0)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TemplatePage"/> class.
        /// </summary>
        /// <param name="options">The page options to enable.</param>
        /// <remarks>
        /// The options parameter is a bitmap constructed from the OptionFlag of Page plugin classes from
        /// the EPiServer.Web.PageExtensions namespace.
        /// </remarks>
        public TemplatePage(int options)
            : base(options)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TemplatePage"/> class.
        /// </summary>
        /// <param name="enable">The enable.</param>
        /// <param name="disable">The disable.</param>
        public TemplatePage(int enable, int disable)
            : base(ContextMenu.OptionFlag | PageStatistics.OptionFlag | SaveCurrentPage.OptionFlag | enable, disable)
        {
        }

        [Obsolete("Use EPiServer.PageBase.ContextMenu.Menu instead of EPiServer.TemplatePage.RightClickMenu", false)]
        public RightClickMenu RightClickMenu
        {
            get { return ContextMenu.Menu; }
        }
    }
}

Examples

Example that adds a custom menu item to the right click menu
CopyC#
protected void Page_Load(object sender, EventArgs e)
{
    RightClickMenu.Items.Add( new RightClickMenuItem("test",null,null,"true",null,RightClickMode.All));
}

Inheritance Hierarchy

System..::.Object
  System.Web.UI..::.Control
    System.Web.UI..::.TemplateControl
      System.Web.UI..::.Page
        EPiServer..::.PageBase
          EPiServer..::.SimplePage
            EPiServer..::.EditPage
              EPiServer..::.TemplatePage

See Also