Wednesday, October 26, 2005

MasterPage, How-To change it on the fly

surely you can also change your masterPage on the fly. the only thing which has to be done is the following thing:

NOTICE: think about the page cicle!!!!

protected override void OnPreInit(EventArgs e){object tpl = Request.QueryString["Template"];if (tpl == null tpl.ToString() == "Default"){this.MasterPageFile = "~/Templates/Category/Standard.master";}else{this.MasterPageFile = "~/Templates/Category/Sample.master";}}

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge