Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:873124
More Search Options
RSS Available
Matching Posts
Securing specific files and folders
I have a folder where I store some PDFs only available for members. I want to use asp.net memberships and roles to prevent non-members from being able to download these files. The location of the member files is as follows: /root/uploads/file/members/ I am trying the following, but it fails to work. <location path="Uploads/file/members"> <system.web> <authorization> <!--<allow roles="Members" />--> <deny users="*" /> </authorization>
Posted to
Security
(Forum)
by
mcleanap
on 11/7/2009
Re: Securing specific files and folders
Yes, that is where the web.config file is. I wanted to use deny users="*" to start with in order to see if it was working under all circumstances. It's still not...I can bring up the file every time. Can specific non aspx documents work in this manner?
Posted to
Security
(Forum)
by
mcleanap
on 11/7/2009
Re: Securing specific files and folders
I tried this originally, and it did not work either. Here is what I have in the members folder: <configuration> <system.web> <authorization> <!--<allow roles="Members" />--> <deny users="*" /> </authorization> </system.web> </configuration>
Posted to
Security
(Forum)
by
mcleanap
on 11/7/2009
Re: Securing specific files and folders
No luck. In case I am doing something wrong, here is the URL I am trying to view...which I can, but would not like to. http://localhost/domainname.ca/uploads/file/members/English/Member%20Notes/2009/filename.pdf
Posted to
Security
(Forum)
by
mcleanap
on 11/7/2009
Re: Securing specific files and folders
It still allows me to view the PDF documents in any folders within the members folder.
Posted to
Security
(Forum)
by
mcleanap
on 11/7/2009
Generic Lists and Find Match
I am creating a list, something like: System.Collections.Generic.List<string> tempList= new System.Collections.Generic.List<string>(); tempList.Add("A person"); tempList.Add("A dog"); tempList.Add("A cat"); So I have a string variable that maybe looks like "A person is not like a cat". What I want to do is if any part of the string is a match in any of the list items, then let me know. True or false. Any ideas? I have tried: bool found = tempList
Posted to
Getting Started
(Forum)
by
mcleanap
on 10/29/2009
Re: Generic Lists and Find Match
Well I ended up doing: bool errorFound = false; foreach (string item in tempList) { if (stringToMatch.IndexOf(item) >= 0) { errorFound = true; break; } } It works. Not sure if it's the best way though.
Posted to
Getting Started
(Forum)
by
mcleanap
on 10/29/2009
DropDownList User Control
I am having trouble getting a DropDownList working as a custom control. I have a dropdownlist that I would like to reuse on several pages...same data. So I create the user control and place the DropDownList on it, populate it with data. Here is some basic code for the .ascx protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // populate the control with data strCulture.DataBind(); // Default the selected value SelectedValue = strCulture.SelectedValue; } } public string SelectedValue
Posted to
Web Forms
(Forum)
by
mcleanap
on 10/27/2009
Re: DropDownList User Control
Here is the exact code. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Database db = DatabaseFactory.CreateDatabase(); string sqlCulture = "Select intCultureID, strCulture, strDisplayCulture FROM culture"; DbCommand cmd = db.GetSqlStringCommand(sqlCulture); DataSet dsCulture = db.ExecuteDataSet(cmd); strCulture.DataSource = dsCulture; strCulture.DataTextField = "strDisplayName"; strCulture.DataValueField = "strCulture"; strCulture.DataBind
Posted to
Web Forms
(Forum)
by
mcleanap
on 10/27/2009
Re: AppSettings or Custom Class
If you had to add another NEW key value pair, you would still have to update the class and recompile anyway, wouldn't you?
Posted to
Configuration and Deployment
(Forum)
by
mcleanap
on 7/17/2009
Page 1 of 5 (41 items) 1
2
3
4
5
Next >
TechNet Edge:
Windows Firestarter Events (Part 3 of 5): IE8 - Browse the Web in Style!
WindowsClient:
The year ahead, 2010.
TechNet Edge:
FOPE Policies Deep Dive Interview
Silverlight:
Silverlight HVP Design Update
WindowsClient:
Windows Client Developer Roundup for 12/28/2009
WindowsClient:
Snoop with 64 bit support
ASP.NET:
jQuery Hide/Close Link
ASP.NET:
Merry Christmas
TechNet Edge:
FPE Customer Story
Silverlight:
Being a writer, and having an editor. A Short Rant.
Channel 9:
Channel 9 Live at PDC09: Dr Brian Brooks (3M)
Channel 9:
C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 13 of 13
Silverlight:
Information for Silverlight HVP Developers…
WindowsClient:
Custom Content Loaders in Silverlight 4.0
WindowsClient:
MVVM Links\Info
TechNet Edge:
Check out how Dolly Parton uses IE8 and Web slices!!!
Silverlight:
A Silverlight HVP Update
Channel 9:
Channel 9 Live at PDC09: This Week on Channel 9 - PDC09 Daily Show Edition Day 1
Channel 9:
Maria Klawe: Scholar, Scientist and Microsoft Board Member
Channel 10:
Play the Bing Sherlock Holmes Game
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online