Click here to Skip to main content
12,821,494 members (25,560 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET4
How to write a (c#) program that checks the Admin or User are currently logged in?
Posted 6-Oct-12 9:35am
Zoltán Zörgő 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
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.

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[^]

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2017
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