Click here to Skip to main content
15,906,097 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everybody I have member in my site , who can see every page, but I wana limit some of my pages to visitors who are not my member.
what should I do ?
Posted

 
Share this answer
 
Hello
You can restrict anonymous user by two methods

1)By Using Session

In this method you have to mantain the UserId in session and have to check the session variable on PageLoad or
PageInit event of the page.If the UserId is your you can carry on , else you can redirect the user to the Main Page.

2)By Using Form authentication

You have to set authentication and authorization in web.config file.

generally It is better to use Form authentication instead of Session but if there are small number of pages then you can
restrict anonymous user by using Session variable.
 
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