Click here to Skip to main content
12,622,741 members (28,598 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET security
Is there any way by which we can secure our data from the clients.

Or

Can we put authentication over parent directory.

examples:Generally to access the images used in website can be accessed like this:

www.websitename.com/images/

How to put limit on that.
Posted 21-Sep-12 8:28am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You can disable directory browsing. Refer:
How to enable directory browsing with IIS7 web.config [^]

Further, using authentication and authorization, you can put security permissions on any folder of your application:
ASP.NET authentication and authorization[^]
MS Support: HOW TO: Control Authorization Permissions in an ASP.NET Application[^]
  Permalink  
Comments
footballpardeep 21-Sep-12 14:05pm
   
thanks
Sandeep Mewara 21-Sep-12 14:10pm
   
Welcome.
footballpardeep 21-Sep-12 14:21pm
   
<configuration>
<system.web>
<authorization>
<deny users="?">




I added this code to subdirectory of images.But still i am able to access it.
Sandeep Mewara 21-Sep-12 14:23pm
   
Did you go through the links I shared?
footballpardeep 21-Sep-12 14:26pm
   
http://www.tarkia.com/blog/tag/asp-net-authorization/ , i used this link, to restrict access to subdirectory
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

URL Authorization in ASP.NET – Securing your websites[^] explains how to set security permissions on individual web pages, web services and sub directories.

Please have a look.
Comments
footballpardeep 21-Sep-12 14:05pm
   
thanks
Tadit Dash 21-Sep-12 14:18pm
   
Anytym... My pleasure...

Thanks a lot...
footballpardeep 21-Sep-12 14:20pm
   
I added it to subdirectory. But i still able to access.

<pre>

<configuration>
<system.web>
<authorization>
<deny users="?">




</pre>
Tadit Dash 21-Sep-12 14:26pm
   
There is nothing in between the pre tags...
You have missed something I guess...
footballpardeep 21-Sep-12 14:28pm
   
i pasted the code, but is not visible, i used ur link, of restricting access to subdirectory
Tadit Dash 21-Sep-12 14:30pm
   
Use "code" tags instead of "pre" tags...
footballpardeep 21-Sep-12 14:32pm
   
tags



<configuration>
<system.web>
<authorization>
<deny users="?">




tags
Tadit Dash 21-Sep-12 14:33pm
   
Don't use any tags, only post the code now.
footballpardeep 21-Sep-12 14:37pm
   
it's again not visible
footballpardeep 21-Sep-12 14:40pm
   
I have just aded a new web.config file to subdirectory.

xml version="1.0"?
configuration
system.web
authorization
deny users="?"
authorization
system.web
configuration
***************************
i removed < >from the code
footballpardeep 21-Sep-12 14:54pm
   
solved thanks
Tadit Dash 21-Sep-12 14:57pm
   
Oh so finally. Congrats...
If it had helped you, then mark it as answer to help others searching the solution easily... You will also be awarded for this action... :) :)

Thanks a lot...
Tadit Dash 21-Sep-12 15:19pm
   
Thanks for accepting...

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100