how to change a master page dynamically? and in which event?

Posted by Rajendra.prasad under ASP.NET on 5/12/2011 | Points: 10 | Views : 1492 | Status : [Member] | Replies : 3
Hi,
how to change a master page dynamically? and in which event?

Regards,
Rajendra




Responses

Posted by: Ndebata on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

I think its a duplicate post by you :)
You can use PreInt for the same.
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx

Thanks,
Debata

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Msahoo on: 5/12/2011 [Member] Starter | Points: 25

Up
0
Down
use Page_PreInit handler to change masterpage dynamically.

for example :
public partial class Default : System.Web.UI.Page

{
protected void Page_PreInit(object sender, EventArgs e)
{
MasterPageFile = "master2.master";
}
}



Thank You.

Regards,
Manoranjan Sahoo
http://www.dotnetsquare.com

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 5/13/2011 [Member] Starter | Points: 25

Up
0
Down
Page_PreInit event

Thanks&Regards
LakshmiNarayana Nalluri.

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response