Click here to Skip to main content
15,886,110 members
Articles / Web Development / ASP.NET

MasterPages reinvented - a Component Based Template Engine for ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.83/5 (124 votes)
27 Apr 2005CPOL9 min read 978.8K   4.2K   266  
User-friendly but powerful template engine which provides clean and painless separation of content and MasterPages (templates).
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace templatedemo.nestedtemplates
{
	/// <summary>
	/// Zusammenfassung f�r samplepage.
	/// </summary>
	public class samplepage : System.Web.UI.Page
	{
    protected Evolve.Portals.Framework.RegionProvider regionProvider1;
    private System.ComponentModel.IContainer components;
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.Panel HeaderPanel;
    protected System.Web.UI.WebControls.Image HeaderImage;
  
		private void Page_Load(object sender, System.EventArgs e)
		{
			// Hier Benutzercode zur Seiteninitialisierung einf�gen
		}

		#region Vom Web Form-Designer generierter Code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: Dieser Aufruf ist f�r den ASP.NET Web Form-Designer erforderlich.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Erforderliche Methode f�r die Designerunterst�tzung. 
		/// Der Inhalt der Methode darf nicht mit dem Code-Editor ge�ndert werden.
		/// </summary>
		private void InitializeComponent()
		{    
      this.components = new System.ComponentModel.Container();
      this.regionProvider1 = new Evolve.Portals.Framework.RegionProvider(this.components);
      // 
      // regionProvider1
      // 
      this.regionProvider1.DefaultRegion = Evolve.Portals.Framework.PortalRegion.Content;
      this.regionProvider1.HostingPage = this;
      this.regionProvider1.PropertySets.Add(new Evolve.Portals.Framework.RegionPropertySet(this.HeaderPanel, Evolve.Portals.Framework.PortalRegion.Top, 0));
      this.regionProvider1.RegionTemplatePath = "maintemplate.ascx";
      this.Load += new System.EventHandler(this.Page_Load);

    }
		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect I'm a gun for hire
Switzerland Switzerland
Philipp is an independent software engineer with great love for all things .NET.
He lives in Winterthur, Switzerland and his home on the web is at http://www.hardcodet.net.

Comments and Discussions