Password Protect a single aspx page

page aspx single a Protect Password

 

In IIS 7 you can either password protect a folder or password protect a specific page. When you password protect a folder all the files or objects within that folder will be password protected. However there maybe some instances where you do not want to password protect the entire content of that folder but merely a single page. To achieve this simply follow these steps.

 

    1. Connect to the web server using IIS 7 Manager.

    2. Click on “Content View “at the bottom of the IIS 7 Manager and navigate to the file you want to password protect.

    3. Right click on the target file and choose “Switch to Features View”.

    4. Double click on Authorization Rules.

    5. Click “Add Deny Rule”.

    6. In the pop up dialogue box, select “All anonymous users”.

    7. Click “OK”.

 

The web.config will now have this element inputted into it. Bear in mind that you do not have to go through IIS 7 Manager to achieve this. You can directly go to your applications web.config file and input the proper elements and properties to password protect a specific page.

 

<location path="file1.aspx">
        <system.webServer>
            <security>
                <authorization>
                    <add accessType="Deny" users="?" />
                </authorization>
            </security>
        </system.webServer>
    </location>


Pingbacks and trackbacks (1)+

9/8/2013 8:44:11 AM #
PWD protect a single ASPX Page

PWD protect a single ASPX Page
Comments are closed