Wednesday, March 28, 2012

Web Config Simple Security Question

I would like to only allow forms authenticated users to see the page Documents.aspx, and if they go to that page and are not authenticated I would like to send them to login.aspx. Is this possible in the webconfig file, if so could you post an example. ThanksThis is no problem at all. You can use the <location> tag to do this:

<location path="Documents.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>

This assumes that the <authentication> part of the web.config file is set up to use forms authentication.

0 comments:

Post a Comment