Groups > Asp .Net > ASP dotNET Security > Re: Restrict subfolder inside folder




Restrict subfolder inside folder

Restrict subfolder inside folder
Wed, 2 Apr 2008 09:44:59 +0000
i have folder name Client that can be access through
http://domainname/client/default.aspx. i give access rule for specific client to
view pages inside Client folder.it's working. when user try to access the page,
login form will prompt up.

my case is, i have subfolder inside Client folder name Client_D that can be
access through http://domainname/client/Client_D/default.aspx. my problem is
when i try to access the page, the login form is not pop-up, it automatically
give me the permission to access the page. how can i solve this?. please help.
tQ
Post Reply
Re: Restrict subfolder inside folder
Wed, 2 Apr 2008 15:20:13 +0000
in the subfolder called Client_D add a web.config file

then add in it the authorization section like this

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
            <allow roles="Special" />
            <deny users="*" />
        </authorization>
    </system.web>
</configuration> 

 

Where Special role is the role you want to enable for your client.s
Post Reply
Re: Restrict subfolder inside folder
Thu, 3 Apr 2008 04:28:48 +0000
hi, 

thanks amrElsehemy. it works!. when i access client/clientD/default.aspx, i will
redirect to login page. 

but it only works on .aspx file. if i have any other type of file like .jpeg,
.kml file, i can automatically view/download the file without asking me the
password & not redirect me to login page. please help. tQ
Post Reply
Re: Restrict subfolder inside folder
Fri, 4 Apr 2008 06:14:58 +0000
Hi

Base on my understanding, I guess you mean protect all files on website(using
forms verification), not just the aspx files. Here is an article about the
"full content protection"

http://support.microsoft.com/?id=893662

Hope it helps
Post Reply
Re: Restrict subfolder inside folder
Fri, 4 Apr 2008 08:37:24 +0000
thanks XiaoYong Dai. i follow the steps in that article and i will redirect to
login page after i click to my file .def.kml. 

but after i entered the correct username & password, i cannot view my
def.kml file. i get error msg :-

 " Internet Explorer cannot display the webpage"

Most likely causes:

You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.


please help. i really need this to be solved. thanks.
Post Reply
about | contact