Click here to Skip to main content
15,918,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi ...

I am attempting to create a login page for Recruitment-system that has (3) access levels. If the access level is 1 (super Admin)they receive the Admin home page,if the level is 2(sub admin) they receive the (sub admin page) and If th access level is 3 (job seeker)they receive the (jobseeker home page)
also depending on access level of the user , some links will be hidden from the user if he is not have the appropriate access level to that page .

1 . what is the stored procedure to validates the username and password?

2-how to do this:
Login method on login button validates the username and password against the credentials in the database, when the user clicks the button and the try Login variable is returns true the access level is taken from the database where the username in the database matches the username text field. .

I'm a beginner in ASP.NET programming plz please help
Posted
Updated 19-Jun-12 5:34am
v3

Hi,This is a very simple solution:
first you need a store proc. to send username and password to data base,
Considering that you have a table like users.it must have a column like usertype!
something like this:
SQL
CREATE PROCEDURE [dbo].[Users_login]
	
	(
	 @Password nvarchar (16) ,
     @Username nvarchar (32)
	)
	
AS
	   SELECT Usertype,Password,Username FROM Users u  
    
    where Username=@Username and 
    u.Password=@Password

    ; 
	RETURN

Depending on the type of the user(returned by the first store proc) you can redirect each user to specific page or you can configure a single page to handle all users(not recommended) like:
ASP
<%= if(_isSuperAdmin) { %>
<div>
some data that only admin is allowed to see
</div>
<% } %>
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900