|
using System;
using System.Web.UI;
using PauloMorgado.Web.UI;
/// <summary>
/// Summary description for HttpModule
/// </summary>
public class MasterModule : IPageModule
{
public MasterModule()
{
}
#region IPageModule Members
public void Init(PageHandlerFactoryWithModules context)
{
context.PageCreated += PageCreatedHandler;
}
#endregion
private static void PageCreatedHandler(object sender, PauloMorgado.Web.UI.PageEventArgs e)
{
e.Page.PreInit += PagePreInit;
}
private static void PagePreInit(object sender, EventArgs e)
{
Page page = (sender as Page);
if (page.MasterPageFile != null)
{
page.MasterPageFile = "~/Site.master";
}
}
}
|
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.