473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Roll based login

Hi All,
I m new to asp.net

I want to make a login page in which login will be roll based ,ie. if A logs in he will be redirected to some other page and if B logs in he will be redirected to some other page
Is there any simple method to do this or I have to write these conditions in code.

Please Help
Thanks in advance
Jun 17 '08 #1
1 1018
abev
22
If you use the build in Login control of asp.net it's pretty simple. Put this in the Loggedin event of the login control. You could easily use a Select...Case or simple If..Then if you wish.

Expand|Select|Wrap|Line Numbers
  1.         'redirect user based on the role
  2.         If Roles.IsUserInRole("LeagueAdministrator") Then
  3.             Response.Redirect("~/users/AccountHome.aspx")
  4.         ElseIf Roles.IsUserInRole("LeagueOfficial") Then
  5.             Response.Redirect("~/users/AccountHome.aspx")
  6.         ElseIf Roles.IsUserInRole("SiteAdministrator") Then
  7.             Response.Redirect("~/users/AccountHome.aspx")
  8.         Else
  9.            'other stuff
  10.         End If
  11.  
Jun 17 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sylvie Stone | last post by:
Hi group - I have an html form for that uses username and password to login to a specific area of the website. The "area" the user wants to go to is based on a pull down menu. Becasue the...
3
by: | last post by:
My questions concerns building a login system based on checking for the existence of the user's email address only.... 1. Is it ok for me to use IP address to allow user to bypass all login and...
1
by: Kigunda Mbogo | last post by:
Hi, I am having a windows 2003 ADS with exchange 2003. I do have OWA running on the same box. I would like to create a form based login page that would appear on a different virtual...
1
by: TK | last post by:
What's the best way to implement roll-base access control with forms authentication? I have a IIS6+ASP.NET server which hosts some ASP.NET web applications as separated path that's like...
2
by: Andre | last post by:
I've got the basic forms based authentication going. A user has to go to my login page before they can access any other pages. The issue is that there are a sub-set of pages on which I don't...
3
by: | last post by:
One thing I did a lot of in Classic ASP involved showing page elements conditionally based on whether a user was logged in or not. Logged in users or "superusers" would get more content and/or more...
1
by: Friends | last post by:
Hi I need to set security for row level but not based on Database user's login. It should be based on the user table login. For the particular user I need to allow only the particular records to...
2
by: Marty | last post by:
I have created a web site and defined 3 rolls: Admin, Manager, Employee I would like to add all users to the Employee roll automatically when they register. Anybody have a suggestion or material...
5
by: Nalaka | last post by:
Hi, I have a asp.net application with forms authentication enabled. Users create private (database driven) messages (pages; like a message board) that is only viewed by logged in users. Now I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.