ASP.Net Images not showing

Posted on 2011-10-10
Last Modified: 2012-05-12
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.
Question by:dodgerfan
    LVL 7

    Expert Comment

    Most likely due to how you are referencing them.

    Show code, & example of path name.
    LVL 33

    Expert Comment

    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...

    Author Comment

    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.
    LVL 14

    Accepted Solution

    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" />
    LVL 14

    Expert Comment

    This article should explain the use of tilde character in your path:

    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

    Author Comment

    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.

    Author Closing Comment

    That was it. Thanks.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    733 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

    21 Experts available now in Live!

    Get 1:1 Help Now