开发者

Excluding root of directory from Forms authentication

I am using ASP.Net forms authentication to secure a dir开发者_Python百科ectory called "pro". This is all working fine, however what we want to do is to exclude the root page within the directory - basically this is a sales page detailing the benefits of registering.

So, my question is whether it is possible to secure a directory, but exclude a particular page within that directory?

The other option, which seems pretty easy but not particularly tidy in terms of the file system is to structure my directories like:

/pro/
/pro/default.aspx
/pro/ (secure anything within this folder)
/pro/loggedin/page1.aspx
/pro/loggedin/page2.aspx

Any help greatly appreciated. Thanks

Al


If you want to allow particular page, then it will be like..

<location path="PageName.aspx">
 <system.web>
    <authorization>
        <allow users="*"/>               
    </authorization>
 </system.web>
</location>


To protect a folder, try the following:

<location path="/pro">
   <system.web>
        <authorization>
             <deny users="?" />
        </authorization>
    </system.web>
</location>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜