Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Masterpage #2

Posted on 2007-11-30
10
Medium Priority
?
602 Views
Last Modified: 2012-06-21
Is it possible to create multiple masterpages in a web application? From your last comment, it sound like it can be done. What I am trying to accomplish here is, I want to create an intranet, two seperate Masterpage, one will be used by users, and second will be used by admin. The season is that I want to hide part of links ( I will use Sitemap) from users. Or what do you think I should do instead?  

Open in new window

0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 12

Expert Comment

by:Munawar Hussain
ID: 20387259
then you can do that ..
Create masterpage for users and make parent of login page.
so every user for login comes to this page and see the public links only
Default.aspx //this page uses master page mspUsers
on click of login button check if user is Admin then

Redirec to
Admin.aspx // this page uses master page mspAdmin


Thanks
0
 

Author Comment

by:VBdotnet2005
ID: 20387266
There won't be a login page. I am planing to use their windows login instead. I am using one of my XP pro to host this intranet app.
0
 

Author Comment

by:VBdotnet2005
ID: 20387273
Do you think I should check to see if, let says, Joe is an admin, redirect him to admin.aspx, and if not joe then redirect to user.aspx?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:Munawar Hussain
ID: 20387296
Instead you check every user for username .. you may have users mapped to Roles .. if is in Admin Role then redirect to Admin.aspx..
yes that make sense..
if it you feel any difficulity in doing that then can look on alternate options too.

thanks
0
 
LVL 12

Accepted Solution

by:
Munawar Hussain earned 2000 total points
ID: 20387308
Here is example how to use that ..
 If User.IsInRole("Administrators") Then
            ' Do something only admins are allowed to-do
' you may redirect to relavent page
        End If
This works great from within ASP.NET pages.  Non-page derived classes dont have a built-in User object.  However, you can always access an ASP.NET Requests User identity context using code like this:
        Dim User As System.Security.Principal.IPrincipal
        User = System.Web.HttpContext.Current.User
        If User.IsInRole("Administrators") Then
            ' Do something only admins are allowed to-do
        End If

HERE IS EXAMPLE FOR THAT

http://weblogs.asp.net/scottgu/pages/Recipe_3A00_-Implementing-Role_2D00_Based-Security-with-ASP.NET-2.0-using-Windows-Authentication-and-SQL-Server.aspx
0
 

Author Comment

by:VBdotnet2005
ID: 20388948
Greate sample. Is above link use File System or HTTP(required virtual directory)?
0
 
LVL 12

Expert Comment

by:Munawar Hussain
ID: 20389918
Is there any issue you are getting with File System based or Virtual Dir based?
Thanks
0
 

Author Comment

by:VBdotnet2005
ID: 20390410
I followed to step # 3, as you suggested above link,  when I logged in as a user at work, he still get the windows logon popped up. I have SQL Express installed and running fine.
0
 
LVL 12

Expert Comment

by:Munawar Hussain
ID: 20390466
First thing .. for development you may use builtin server that comes with VS2005 but to access from network (other computers) you must deploy under IIS (Virtual directory) because light weight server (based on cassani) is just for development and dont have all facilities required for website hosting..
Thanks
0
 

Author Comment

by:VBdotnet2005
ID: 20390489
IIS is installed on my XP pro. That would still be a problem?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question