Click here to Skip to main content
Rate this: bad
good
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
Edited 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
0 Sergey Alexandrovich Kryukov 380
1 CPallini 375
2 BillWoodruff 314
3 George Jonsson 279
4 OriginalGriff 227
0 OriginalGriff 5,030
1 CPallini 4,225
2 Sergey Alexandrovich Kryukov 3,604
3 George Jonsson 2,831
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 5 Dec 2011
Copyright © CodeProject, 1999-2014
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