Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
hi,
how to restrict user when they are not allow to use that aspx page in my application asp.net4.0. there are 4 type users all are having different type of access level, so how to protect from un outherized user.
Posted
Comments
Sergey Alexandrovich Kryukov 25-Jul-12 2:13am    
And what part of this feature would be a problem? What did you try so far?
--SA

This is one of the possible solutions:
http://stackoverflow.com/questions/8954728/asp-net-authentication-to-allow-prevent-page-access-and-show-hide-link-at-the-sa[^].

Alternatively, you can redirect the user to a different page (such as "access denied") depending on the user's privileges. Here is how:
http://stackoverflow.com/questions/4834387/how-to-redirect-users-to-an-asp-net-page-when-not-authorized[^].

Perhaps, the most general solution would be generating different page content for different classes of users, which you can always do in your code-behind.

—SA
 
Share this answer
 
v4
Comments
Prasad_Kulkarni 25-Jul-12 2:28am    
Good links! +5
Sergey Alexandrovich Kryukov 25-Jul-12 2:32am    
Thank you, Prasad.
--SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Jul-12 2:16am    
Useful reading, my 5, but the main OP's problem is not the authentication itself but its use.
I suggested some more pin-pointed solutions, please see.
--SA
Prasad_Kulkarni 25-Jul-12 2:28am    
Thank you SA!
As per OP's question he require different access levels for his 4 users. So I thought the authorization will help him to move on.
Sergey Alexandrovich Kryukov 25-Jul-12 2:32am    
Sure, I already said it's helpful; I just focused on the less obvious and more essential aspect: what to do with the pages to be restricted.
--SA
Prasad_Kulkarni 25-Jul-12 2:37am    
No, you said useful reading (but not helpful answer :( ). I also given direction with essential aspect (hmm, but failed with less obvious one).
Sergey Alexandrovich Kryukov 27-Jul-12 17:20pm    
OK, OK, I said that. Helpful or not, depends on some other factors, but it's helpful generally. The OP might already know about authentication or not.
--SA

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