Click here to Skip to main content
15,890,995 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys
i have an asp.net source and im trying to make a part in my source which every user can have its own profile.my approach is every user should register and i store users information in Database and when user tries to log in i read user name and password form Database and redirect them to a specific page(for example to public page or admin page)
but i dont know how to prevent public user from accessing admins page.i mean if user instead going to:
C#
mysite.com/public/user.aspx


Tries this url:
C#
mysite.com/admin/user.aspx


user is actually seeing admin page which i don't want! i want users not to be able to open admin folder.how can i do it?and is my approach for profiling correct?is there a better way i can manage my users and set authorization and restriction?can any one help me with some link which i can learn more?
Tanx
Posted
Comments
S@53K^S 4-Oct-12 10:03am    
try check for the user authorization level in the page_load event if the user is not authorized redirect them to the error page.

1 solution

You can create seprate folder for admin in root directory and add all the required pages for admin in admin folder. For login in admin u can write the address in the url as for example:- mysite.com/admin/adminlogin.aspx.

And for user u can create a link for user login in index pages.

U can create seprate login page for user and admin
 
Share this answer
 

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