Saturday, July 19th, 2008

Changing the MasterPageFile Dynamically

In a project i had been working on i wanted to have a central MasterPageFile that had variable sub MasterPageFile’s. I finally figured out that you have to override the “OnPreInit” Event on the page you wish to modify. Here is an example:-

protected override void OnPreInit(EventArgs e)
{
 
[...]

|
No Comments » - Posted in CSharp Commands | by admin