Click here to Skip to main content
15,905,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI
How can I have two separate login page , for Example One for managers and one for users

my Config file :
HTML
<authentication mode="Forms" >
      <forms loginUrl="LoginManagers.aspx" timeout="2880"  />
      </authentication>
===============================
 <location path="Manages">
    <system.web>
      <authorization>
        <allow roles="Manager" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>


How do I adjust the configuration file؟
Posted
Comments
Thanks7872 25-Nov-13 4:00am    
This question makes no sense. If i access your application say www.xyz.com/login,how it will come to know i am manager or not?

Instead,you can provide two logins as Manager and Employee e.g. many job portals provide such functionality for Employer and Candidate. Once user lands on appropriate page,proceed as usual. What's the problem?
NorouziFar 25-Nov-13 4:26am    
you don't understand me,
for example i want to go to "manage folder ", manage folder is protect with role "manage" and had some pages , now when i click link manager show me login page for login to manager pages . it is good not problem , now i want to go "user folder" . user folder is protect with role "users" and had some pages , now when i click url user.aspx in "user folder" i automatically come back to login.aspx page for write username and password , but i dont want to go login.aspx page ,rather i want automatically come back userlogin.aspx and Where username and password to login, do you understand me what i want ?

sorry : my language is weak i use "http://translate.google.com/" Persian to English

1 solution

Why would you want that? Instead, use the information when they do log in to determine if they are Manager or User and direct them to the appropriate page after that. Roles are a good way to do that, as they can also be user to restrict which folders a logged-in user can access via the web.config file.

A login is a login: before that you have no idea who the person is, so you can't create a "simple" version for managers that doesn't need a password for example - as anyone can use it until they are logged in.
 
Share this answer
 
Comments
NorouziFar 25-Nov-13 4:30am    
you don't understand me, for example i want to go to "manage folder ", manage folder is protect with role "manage" and had some pages , now when i click link manager show me login page for login to manager pages . it is good not problem , now i want to go "user folder" . user folder is protect with role "users" and had some pages , now when i click url user.aspx in "user folder" i automatically come back to login.aspx page for write username and password , but i dont want to go login.aspx page ,rather i want automatically come back userlogin.aspx and Where username and password to login, do you understand me what i want ? sorry : my language is weak i use "http://translate.google.com/" Persian to English
OriginalGriff 25-Nov-13 4:55am    
I do understand you - your user does not have a role as a manager (or a user) until he has logged in, so there is no way to prohibit users from the manager folder until they have logged in and proven themselves to be users!

Use a single login page, and go from there!

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