Loading master pages dynamically is useful in 2 situations.
1. u can enable users ot customize the apperance of the website by loading differnent master pages. u can display a menu of masterpages and allow ur users to pick thier favorite layout.
2. in co-branding.when users link to one site to another partner website, they should not be aware of travelling to a new website, u can maintain this illusion by dynamically loading differernt master pages based on a query string passed from a partner site.
Master page can only be loaded in page preinit event.
To enable this for multiple content pages, create a base page . and register it in the web configuration file.
using system;
suing system.web.ui;
using system.web.profile;
public class dynamicmasteroage:page
{
protected override void onPreInit(Eventargs e)
{ this.MasterPageFile = (string )Context.profile['MasterPageFile'];
base.OnpreInit(e);
}
}
1. u can enable users ot customize the apperance of the website by loading differnent master pages. u can display a menu of masterpages and allow ur users to pick thier favorite layout.
2. in co-branding.when users link to one site to another partner website, they should not be aware of travelling to a new website, u can maintain this illusion by dynamically loading differernt master pages based on a query string passed from a partner site.
Master page can only be loaded in page preinit event.
To enable this for multiple content pages, create a base page . and register it in the web configuration file.
using system;
suing system.web.ui;
using system.web.profile;
public class dynamicmasteroage:page
{
protected override void onPreInit(Eventargs e)
{ this.MasterPageFile = (string )Context.profile['MasterPageFile'];
base.OnpreInit(e);
}
}
No comments:
Post a Comment