Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Masterpage #2

Posted on 2007-11-30
10
Medium Priority
?
612 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
  • 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

876 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