Click here to Skip to main content
12,445,470 members (62,715 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
I have two master page
1.Admin.Master
2.Operator.Master
and two content page
1.Default1.aspx
2.Default2.aspx
Both content pages inherits page.But when I login through Operator both content page inherit Admin.Master
,I want both page should inherit Operator.Master page.
Posted 4-Dec-11 18:06pm
Updated 4-Dec-11 18:13pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I think you want to change the master page dynamically. You can add a Pre_Init method in your page and in that method you can change the master page. Like

protected void Page_PreInit(object sender, EventArgs e)
{
    this.Page.MasterPageFile = "~/Operator.master";
 
}

You also can put some condition in the above method if require.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160811.3 | Last Updated 5 Dec 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100