• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

ASP.Net Images not showing

I have an ASP.Net web application (C# code behind, VS 2008). The images I'm using will not display in any of the forms I'm using. I've looked around and tried various suggestions but I have not been able to find the solution yet. Any suggestions? The Images sit in a folder called Images within the application. I am using forms security. Any help is apporeciated.
0
dodgerfan
Asked:
dodgerfan
1 Solution
 
Bill NolanCommented:
Most likely due to how you are referencing them.

Show code, & example of path name.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
How are you displaying the images?  With <img> tags?  Some other method?  Can you post some code as a sample?

Has anyone changed the permissions on the Images folder recently?  The process IIS runs under would need to have at least read access to that folder...
0
 
dodgerfanAuthor Commented:
Here is an example of how I am using them:
<asp:HyperLink ID="HyperLink2"  ImageUrl="Images/ViewForm.gif" runat="server" />
The permissions on the Images folder remain the same. I'm just not sure what is happening.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
CtrlAltDlCommented:
Is your app running in the root folder or is in a directory?

Either way this should fix the path names to your images:
<asp:HyperLink ID="HyperLink2"  ImageUrl="~/Images/ViewForm.gif" runat="server" />
0
 
CtrlAltDlCommented:
This article should explain the use of tilde character in your path:
http://msdn.microsoft.com/en-us/library/ms178116.aspx

It essentially replaces the tilde character with the physical path of your application.  Since many times the dev path (http://localhost:5344) is not the same as your "live" path (ie http:mydomain.com/MyApp).
0
 
dodgerfanAuthor Commented:
CtrlAltDl,
Thanks for the info. I will give this a try first thing tomorrow when I sit down at my dev machine. It makes more sense now.
0
 
dodgerfanAuthor Commented:
That was it. Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now