Last post Apr 16, 2010 08:02 AM by mkh786
Apr 15, 2010 02:15 PM|mkh786|LINK
In the personal website, how do we prevent user from entering (say links page) if user has not logged in the page.
I am able to go to the links page without loging to the login page -
Apr 15, 2010 02:22 PM|N_EvilScott|LINK
If you are using forms authentication with the asp.net login controls then you can simply do this in the code behind.
Apr 15, 2010 02:27 PM|amtprajapati|LINK
Either you need to do Implement Form Authentication for Normal Authentication
1) Form Authentication :
2) Normal Authentication : When User loged in Store User ID in Session and check this Session Varialble value in Page bage or in Global.asax file if Session["USerID"] is null then Rediect to login page.
//check for User ID
If (! (Convert.ToInt32(Sesion["UserID"]) > 0))
//rediect to login page
Apr 15, 2010 02:48 PM|RichardY|LINK
If you are using the standard ASP.Net membership/roles providers, then use the ASP Configuration tool (wizard) to implement roles for your website and then create rules to allow access or restrict access to folders in your website. This will require moving
any pages that you want to protect to a separate folder. This tool is available as an option in the Projects menu or in the toolbar at the top of the solution explorer. You can use this tool as long as it resides on the same machine as the web site.
Otherwise you can test for authentication in the page load event handler of an individual page as was suggested in earlier posts.
Apr 16, 2010 08:02 AM|mkh786|LINK
Thnak You all for great feedback - God Bless!!