0

I have one issue in my webpage. Actually I have developed asp.net 3.5 website. I have created a webpage named HR.aspx under Sub Directory in my project root directory.

Webpage Location

(ProjectName) >> Department (Subfolder) >> HR (Subfolder) >> HR.aspx

and I have the code in this file to open a file like pdf.

My file location folder is under my project.

File Location

(ProjectName) >> SIPL (SubFolder) >> Department (Subfolder) >> HR (Subfolder) >> HR.pdf

My issue is when I put the HR.aspx page under root directory the file is opening successfully and when I put this page under subfolder (as shown above) it not opening and showing file not found error. I think page not find the path of the file because it is in subfolder. How to overcome this issue. Please help.

Dinesh Kumar
  • 101
  • 1
  • 11
  • 22
  • am i wron but the right way to show local files is this way file://c:\bla.jpg And be sure this only works local (client side) – Jordy van Eijk Mar 11 '13 at 09:46

2 Answers2

1

It should be

<pre>
    <img src="\Images\Open.jpg"/>
</pre>

To use a file in you web application. You should have a folder in your application.
Say you have a folder Images at your root directory.
Then you should use the relative path of you image.
More Details
HTML img and ASP.NET Image and relative paths

Edit 1

Since you have written

<img src="C:\Users\Administrator\Desktop\Open.jpg"/>

which is wrong for the web application.
If you write like above the browser will look for the local system file.
Rather than file on the application-server.

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117
0

please relative path to select the image . So first copy the image in any of your project solution folder and refer like:

<img src='\NewFolderName\Open.jpg'/>
Abdusalam Ben Haj
  • 5,343
  • 5
  • 31
  • 45