Click here to Skip to main content
11,413,961 members (76,119 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
Add your own
alternative version

Page Template Framework for ASP.NET 1.1

, 16 Nov 2004
The Page Template Framework for ASP.NET 1.1 provides a configurable solution for creating page templates in a Web application. Using this framework, page templates are stored in an XML file, and can be dynamically configured without recompiling the Web application.
PageFramework_demo.zip
PageFramework_demo
PageTemplateSample_cs
bin
Boardworks.Web.UI.PageFramework.dll
PageTemplateSample.dll
Boardworks.Web.UI.PageFramework
bin
Release
Boardworks.Web.UI.PageFramework.dll
Boardworks.Web.UI.PageFramework.csproj.user
Config
Controls
DivisionTemplate
General
MainTemplate
Global.asax
PageTemplateSample_cs.csproj.webinfo
Templates
PageTemplateSample_vb
bin
Boardworks.Web.UI.PageFramework.dll
PageTemplateSample_vb.dll
Boardworks.Web.UI.PageFramework
bin
Boardworks.Web.UI.PageFramework.dll
Boardworks.Web.UI.PageFramework.vbproj.user
Config
Controls
DivisionTemplate
General
MainTemplate
Global.asax
PageTemplateSample_vb.vbproj.webinfo
Templates
PageFramework_src.zip
PageFramework_src
PageFramework_src
cs
Boardworks.Web.UI.PageFramework
bin
Release
Boardworks.Web.UI.PageFramework.dll
Boardworks.Web.UI.PageFramework.csproj.user
Config
vb
Boardworks.Web.UI.PageFramework
bin
Boardworks.Web.UI.PageFramework.dll
Boardworks.Web.UI.PageFramework.vbproj.user
Config
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;
using Boardworks.Web.UI.PageFramework;
using Boardworks.Web.UI.PageFramework.Config;

namespace PageTemplateSample
{
	/// <summary>
	/// The Default Web Form for the application, which inherits
	/// from the Page Template Framework PageBase
	/// </summary>
	public class _Default : Boardworks.Web.UI.PageFramework.PageBase
	{
		/// <summary>
		/// Used to display the current Page's title
		/// </summary>
		protected System.Web.UI.WebControls.Label lblContentTitle;

		/// <summary>
		/// Method called when the Page is loaded for the current Request
		/// </summary>
		/// <param name="sender">The current Page instance (i.e. ASP.Default_aspx)</param>
		/// <param name="e">The event's arguments</param>
		private void Page_Load(object sender, System.EventArgs e)
		{
			//
			// If this page is being viewed under the DivisionTemplate, then
			// programatically change the way the GeneralNavigation is displayed
			//

			// Load the current Page.config file into an instance of the PageConfig class
			PageConfig pc = PageConfig.Load(Server.MapPath(PageConfig.PageConfigFilePath));

			// Find the current requested Page in the Page.config file
			Boardworks.Web.UI.PageFramework.Config.Page page = pc.FindPage(this.Request);

			// Check to ensure this page is registered with the Page.config file
			if (page != null)
			{
				// Check to see if this page's current Template is DivisionTemplate
				if (page.TemplateName == "DivisionTemplate")
				{
					// Find the General Navigation Control by it's UniqueName attribute
					PageTemplateSample.Controls.General.Navigation nav = (PageTemplateSample.Controls.General.Navigation)this.FindControl("GeneralNavigation");

					// Change the LineBreak to a Pipe symbol for the Navigation
					nav.cLineBreak1.Text = nav.cLineBreak2.Text = nav.cLineBreak3.Text = "|";
				}
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Scott Van Vliet
Web Developer
United States United States
Scott Van Vliet is a Principal Consultant with Neudesic based in Irvine, CA. He has been designing and developing technology solutions for the past 8 years, and has worked with Microsoft .NET technologies for over 3 years. Scott is currently developing solutions with ASP.NET 2.0, C# 2.0, Windows Presentation Foundation (codename "Avalon"), SQL Server 2000/2005, Reporting Services and SharePoint.

Scott welcomes feedback and can be reached through his Weblog at http://weblogs.asp.net/skillet/.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150427.2 | Last Updated 16 Nov 2004
Article Copyright 2004 by Scott Van Vliet
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid