Solved

Masterpage #2

Posted on 2007-11-30
10
528 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:needo_jee
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 12

Expert Comment

by:needo_jee
Comment Utility
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:
needo_jee earned 500 total points
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

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

Expert Comment

by:needo_jee
Comment Utility
Is there any issue you are getting with File System based or Virtual Dir based?
Thanks
0
 

Author Comment

by:VBdotnet2005
Comment Utility
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:needo_jee
Comment Utility
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
Comment Utility
IIS is installed on my XP pro. That would still be a problem?
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now