Click here to Skip to main content
15,881,690 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i want to write code for redirecting one master page to another master page in asp.net.
pease any body help me.
Posted
Updated 28-Jan-15 19:27pm
v3
Comments
Sergey Alexandrovich Kryukov 29-Jan-15 1:29am    
What does it mean? master page is not a "real" page to be redirected to; this is the artifact which only exists on the server.
—SA
Sinisa Hajnal 29-Jan-15 2:54am    
You cannot redirect from master page to master page, they are just templates used by the pages. If you redirect from page A with MasterA to page B with MasterB you "redirect" between the masters.
santhu888 29-Jan-15 7:06am    
protected void Page_PreInit(object sender, EventArgs e)
{
try
{
if (conduction1)
this.Page.MasterPageFile = "~/MasterPage.master";
else
this.Page.MasterPageFile = "~/Master.master";

}
catch (Exception ex)
{

}
}
Sinisa Hajnal 29-Jan-15 7:57am    
This changes master page object for the page. If it works. I must admit I've never seen anything like this. Why are you doing it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900