Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hi I have a folder in my root directory and it contain a text document.I want to restrict that document from being access.In my default.aspx page a button is present.
My folder structure looks like

- NewFolder1 (I want to restrict this folder)
    Secret.txt
    web.config
- Default.aspx
    Default.aspx.cs
  web.config

I was googling for come over this but i am unable
I wrote inside web.config(NewFolder1) file:
XML
<system.web>
     <authorization>
       <deny users="*"/>
     </authorization>
   </system.web>

and some where i found to do like
XML
<location path="NewFolder1">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>


but still the same please suggest me how would i come across the problem.
Thanks.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900