CTRL + F5 images not showing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jollywg
    New Member
    • Mar 2008
    • 158

    CTRL + F5 images not showing

    I have several jpg images (including my header) stored in App_Data/Images. I then drug the images onto my web form.

    They display great on the web form, however when I press f5 or ctrl + f5 they do not show. All I get are the is the little red 'x'. I know the paths are correct after checking them. Any suggestions?

    Thanks
    Jolly
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    This is a path problem buddy....
    you must have specified the path as App_Data/Images/somepic.jpg

    but that's not it.....

    Use Server.MapPath( "App_Data/Images/somepic.jpg").. ....
    to allow the asp.net server to locate the pic....

    as when you do App_Data/Images it searches it in the local machine path......

    and when you map the server path using Server.MapPath( ).... it attaches the server path to your image folder and thus... asp.net server can now locate your specifed pic.....

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      One other thing that you can try is not putting your images in your App_Data folder.

      The App_Data folder is supposed to contain:

      Application data files including MDF files, XML files, as well as other data store files. The App_Data folder is used by ASP.NET 2.0 to store an application's local database, which can be used for maintaining membership and role information.

      The App_Data folder is not supposed to be used for your application's resources (like images). Create a new folder in your project (called "images" or something to that effect) and place your images in that folder.

      -Frinny

      Comment

      • Jollywg
        New Member
        • Mar 2008
        • 158

        #4
        Frinny, your da bomb. I moved the images out of my app_data folder, drug them back onto my web form and they pulled up with no problems.

        Thanks!

        Comment

        Working...