Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
How to write a asp.net (c#) program that checks the Admin or User are currently logged in?
Posted 6-Oct-12 8:35am
Comments
Zoltán Zörgő at 6-Oct-12 14:41pm
   
Where? How? What?
This question makes no sense at all. Please, improve your question, so we others could also understand what you really want.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It depends on who has logged in and what role that particular logged user is defined in the system.
 
On high level, user logs in and based on the successful authentication, you are aware of the user. This user has predefined role (set at the time of creation of the account). Based on this role, you know if he is an admin or a normal user. According to the role, you take action and display.
 
2 options:
Either, define roles by yourself and attach them to users at the time of account creation OR
use ASP.NET roles feature.
 
Refer:
Understanding ASP.NET Roles and Membership - A Beginner's Tutorial[^]
Authenticate User by Roles in ASP.NET[^]
MSDN: How To: Use Role Manager in ASP.NET 2.0[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 6 Oct 2012
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