Thursday, September 11, 2008

Password Protecting Single File

Password protecting comes under the section of ASP Membership & Security. ASP.Membership & Security can be employed to protect a file-access from an unauthorized user. By default, we can protect aspx pages only. However, we can add additional file-extension using the IIS Configuration Manager.

Below code segment protects secret.aspx from unauthorized uesrs. A '?' denotes anonymous/unauthorized users; whereas a '*' represents all user.


   <location path="Secret.aspx">
         <authentication mode=”Forms” />
            <deny users="?"/>

No comments:

Best viewed in Internet Explorer 8.