Community discussion forum

how to restrict the user by visiting restricted area without login..!

  • 7 months ago
    hi, Em a newbie in ASP.NET..! recently i completed project in ASP.NET with lots of trouble:( In my project, login page is available in which user login the account and add, edit, delete transaction of products successfully. i have also the admin area..! in my project administrator can create the account, change the password of any user or do anything..! now my problem is that..! if any user remember the any page name then it can easily visit every page without login or also the admin area by through the navigation :( now i want to restrict the user for visiting the pages without login..! in my project login.aspx is use for the login page and after login successfully user redirect to the success.aspx in which following menu is available: 1) add record (record.aspx) 2)edit record record (edit.aspx) if user write directly record.aspx in address bar then page open succesfull:( i want to restrict the user if they do this:( now tell me a in a easy way please :(
    Post was edited on 02/04/2009 20:53:40 Report abuse
  • 7 months ago
    Hi asad, you need to implement forms authentication which will allow you set access priveliges on specific pages and folder within your site. Have a look at the [Forms Authentication explanation on MSDN ](http://msdn.microsoft.com/en-us/library/aa480476.aspx)and you should be able to figure it out for yourself. Regards, Martin
  • 7 months ago
    Hi, I have done this in different ways in the past, but the way i use mainly is to create a formsauthentication cookie when they have logged in, set this to not persist, so when they close the browser it will disappear. Then in the record.aspx page load event, check whether they are signed in using the formsauthentication system and if they are leave them where they are, or bounce them back to the login page. Regards Si

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!