ASP.net Disallow Direct Access to Admin Directory

We have a directory named Admin in the root folder of an ASP.net (4.0) web application.

I have created a route to the Admin/Dashboard.aspx

~/administrator/dashboard/

and it works fine.

I was curious if I could disallow to run the file through direct access, even to the administrators.

~/Admin/Dashboard.aspx

Is it doable?

Please help.

Answers


You can do with some web.config setting like below

<location path="~/Admin/Dashboard.aspx">
<system.web>
<authorization>
<allow roles="admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>

Need Your Help

Unix: Getting execl functions to read from stdin

c unix stdin pipe

I'm having trouble calling execl with "/usr/bin/sort" in a C program I'm writing. The call to sort doesn't seem to be reading from stdin or printing any output. Code below:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.