Solved

pointing to a file from aspx c#

Posted on 2011-09-22
6
216 Views
Last Modified: 2013-12-17
I want my web page to point to a file, and I have placed the file in the same location as my aspx file, but when i try to look for the file, it can not find it inside teh .cs code

But this does not seem to be the case inside a aspx file, since that lookks at an image file which it does seem to find, both the image and the text file are in the same directory.

When I look at the current directory environment variable it is pointing me to a location where the webserver is but in there I do not see any of my files ...

I am not sure how i can get my cs code to point tot eh same directory to where the aspx file is actually located. Or i dont know how to add a pointer to a the file i want in the aspx file ..

any help would be appreciated ...
0
Comment
Question by:jhacharya
  • 5
6 Comments
 
LVL 2

Author Comment

by:jhacharya
ID: 36582161
0
 
LVL 2

Author Comment

by:jhacharya
ID: 36582172
0
 
LVL 2

Assisted Solution

by:jhacharya
jhacharya earned 0 total points
ID: 36582216
I dont knwo why I can not see the file when i try to run the application ...

It seems to want to look for the file  in C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\

and if i place the file in here it will see it, but I need the code to look for the file from the same location as where the aspx code is.

I dont know why I can get an image but cant see the text file in c#

<img src="picture.png" /> inside the aspx
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Accepted Solution

by:
morgulo earned 500 total points
ID: 36582629
0
 
LVL 2

Author Closing Comment

by:jhacharya
ID: 36984596
This did not solve my problem, but it did give me some new reading to do so in that aspect I am awarding the points, to at least give thanks fotr the help
0
 
LVL 2

Author Comment

by:jhacharya
ID: 36962842
I have added a comment qand awarded the points, the solution did not fix the problem but i did get some usefull reading accomplished by going down the pasth suggested
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now