Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 16, 2010 12:02 PM by mkh786
Apr 15, 2010 06:15 PM|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 06:22 PM|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 06:27 PM|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 06:48 PM|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 12:02 PM|LINK
Thnak You all for great feedback - God Bless!!