TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
shshva
NA
37
18.9k
How to display master pages dynamically based on user
Jan 26 2012 1:19 AM
Hi,
I have three roles engineer,supuvisor and manager for my website
and I have three master pages engineer.master , supervisor.master and mgr.master
and i have some specific aspx pages for engineer,supervisor and manager.
I want to use engineer.master page for an aspx page if engineer user is logged in and want to use supervisor.master page if supervisor logged in ans so on for the manager.
How can I achieve this?
Thanks in advance!!!
Im getting error
here is the code :
protected override void OnPreInit(EventArgs e) {
base.OnPreInit(e);
switch (Session["role"].ToString())
{
case "1":
MasterPageFile = "ME.Master";
break;
case "2":
MasterPageFile= "Supervisor.Master";
break;
case "3":
MasterPageFile = "Manager.Master";
break;
default:
MasterPageFile = "default.Master";
break;
}
Thank you
Reply
Answers (
3
)
What property must you set, and what method must
Microsoft .Net Certifications