Click here to Skip to main content
15,886,070 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create forum application like asp.net forums. when user posts after login. when anonymous person sees the post and if he wants to reply

he will clck reply button. At that time he should register or he should login.

here i want how when he click reply how we can check he is authenticated or not.

please help me

thanq.
Posted

Maintain a session when user login is successful.
In Reply button click event check the session variable and if session is null then ask user to register or login.
hope it helps you.
 
Share this answer
 
Comments
rkthiyagarajan 9-Sep-11 6:39am    
ya good one
If you use MembershipProviders (either MS or your own) then you can use the User object:
C#
if (User.Identity.IsAuthenticated)
   {
   ...
   }
MSDN can help: http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user.aspx[^]
 
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