开发者

Disabling folder with pages in asp.net

开发者 https://www.devze.com 2023-04-03 17:36 出处:网络
i have a simple question How to disable a folder with aspx开发者_开发问答 pages in asp.net Thw folder is \"Administration\" and i want to disable it that it cannot be called in browser by typing ...

i have a simple question

How to disable a folder with aspx开发者_开发问答 pages in asp.net

Thw folder is "Administration" and i want to disable it that it cannot be called in browser by typing .../Administratin/edit.aspx, or that simple to redirect to a login page if we want to go to the administration part


First enable forms based authentication. This can be done for VB and C#.

Next you have to specify who will have access to what. This can be done in the web.config.

Apologies if these articles are a little out of date.


Use a locations element and config settings to restrict access to folders.

<location path="Administration">    
    <system.web>    
        <authorization>
            <allow roles="Administrators" />
            <deny users="*" />
        </authorization>
     </system.web>   
</location>   


Change the NTFS security permissions on the Administration Folder for

    <drive>:\intepub\wwwroot\...\Administration

and restrict access via that way.

You can also right click go to properties in IIS for the folder and remove various granular browsing permissions.

You can also edit the web.config and change permissions there.

0

精彩评论

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

关注公众号