Solved

Prevent webpage access using forms authentication

Posted on 2012-03-20
2
240 Views
Last Modified: 2012-03-21
Dear experts,

I have used the following two articles to setup forms security with roles.

http://support.microsoft.com/kb/301240
http://support.microsoft.com/kb/311495

Now I can use the roles to access or not give access, but I am wondering how to do this best.

I can show or hide menu items bases on the role, but a user can then still access pages if he/she manual enters the url manually. What is the best approach to prevent users from accessing a webpage?

Best regards,
MB
0
Comment
Question by:mark_norge
2 Comments
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 500 total points
ID: 37741103
There are 2 ways you can do this:

1 - In Code - In your page load handler include the line:

if (Roles.IsUserInRole("RoleName")) then
  Response.Redirect("/")
end if

or, the easier way is to use your web.config file - http://www.codeproject.com/Articles/2905/Role-based-Security-with-Forms-Authentication
0
 

Author Closing Comment

by:mark_norge
ID: 37746108
Both solution worked fine indeed. I prefer the second.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now