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

restricted area , login , user Pasadena, United States
  • 11 years 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 :(
  • 11 years 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 ]( you should be able to figure it out for yourself. Regards, Martin
  • 11 years 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).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan