using System;
using System.Web;
using System.Web.Configuration;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// Used as the base class for all ASP.NET Web Forms in the application
/// </summary>
public class AppPageBase : System.Web.UI.Page
{
//
// Constructors
//
/// <summary>
/// Creates a new instance of an AppPageBase object
/// </summary>
public AppPageBase() : base()
{
// Local Variables
// Begin
this.Init += new EventHandler(this.AppPageBase_Init);
this.PreInit += new EventHandler(this.AppPageBase_PreInit);
}// end AppPageBase
//
// Event Handlers
//
/// <summary>
/// Event handler for the Init event of the Page
/// </summary>
private void AppPageBase_Init(object sender, System.EventArgs e)
{
// Local Variables
HtmlMeta metaTag = null;
// Begin
if (!string.IsNullOrEmpty(this.MetaDescription))
{
metaTag = new HtmlMeta();
metaTag.Name = "description";
metaTag.Content = this.MetaDescription;
this.Header.Controls.Add(metaTag);
}// end if
if (!string.IsNullOrEmpty(this.MetaKeywords))
{
metaTag = new HtmlMeta();
metaTag.Name = "keywords";
metaTag.Content = this.MetaKeywords;
this.Header.Controls.Add(metaTag);
}// end if
}// end AppPageBase_Init
/// <summary>
/// Event handler for the PreInit event of the Page
/// </summary>
private void AppPageBase_PreInit(object sender, System.EventArgs e)
{
// Local Variables
AppCookie ac = null;
// Begin
ac = new AppCookie();
if (ac.PreferredTheme != string.Empty && ac.PreferredTheme != "")
base.Theme = ac.PreferredTheme;
else
base.Theme = WebConfigurationManager.AppSettings["AppDefaultTheme"];
}// end AppPageBase_PreInit
//
// Methods
//
/* none */
//
// Properties
//
private string _metaDescription;
/// <summary>
/// Gets or sets the META description of the Page
/// </summary>
public string MetaDescription
{
get { return this._metaDescription; }
set { this._metaDescription = value; }
}// end MetaDescription
private string _metaKeywords;
/// <summary>
/// Gets or sets the META keywords of the Page
/// </summary>
public string MetaKeywords
{
get { return this._metaKeywords; }
set { this._metaKeywords = value; }
}// end MetaKeywords
}// end class AppPageBase