red X image problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Iman100
    New Member
    • Feb 2008
    • 7

    red X image problem

    Hi,

    I couldn't find out why the image does not appear when I run my asp program file. The path for the image is correct. And in the Design View the image is there, but when I run the code the image appears red X. I could not find a clear solution for this problem. Any advice is really appreciated.

    Thanks
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Right click and select properties on the red X in the browser.
    What does the location say for the image there?
    Is the location it claims to be looking for the image at the one you thought it would be?
    Does it have the correct capitalizations and such?

    Comment

    • DrBunchman
      Recognized Expert Contributor
      • Jan 2008
      • 979

      #3
      If you're sure that your URL is correct for the image then it may be a permissions problem. That would explain why it is displayed in design view but not when you're running the code.

      Find the image in the file system, right click on it and select the security tab. You should be able to see whether you have permission to view the image. The image has probably inherited permissions from it's parent folder so you should check the security settings for that as well.

      Hope this helps,

      Dr B

      Comment

      • Iman100
        New Member
        • Feb 2008
        • 7

        #4
        Originally posted by Plater
        Right click and select properties on the red X in the browser.
        What does the location say for the image there?
        Is the location it claims to be looking for the image at the one you thought it would be?
        Does it have the correct capitalizations and such?
        Thanks a lot for your quick reply. I have just found out that if I moved the image on the same folder ( with aspx files) it will appear and if I left it in the App_Data folder which is under the project file, it will appears as red X image. I am wondering why this happen.

        Note that the image located on both directories now. As programming wise, I would like to keep the image in App_Data. Is there is a way to figure out why
        ImageUrl="targe t.gif" works, but ImageUrl="~/App_Data/target.gif" does not work? Thanks again

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          App_Data is a special folder and is not ment to contain images, it was designed for holding class files and other compilable data-centric files.

          Comment

          • Iman100
            New Member
            • Feb 2008
            • 7

            #6
            Originally posted by Plater
            App_Data is a special folder and is not ment to contain images, it was designed for holding class files and other compilable data-centric files.
            Thanks a lot for clarifying this point for me. I am new to asp.net. Now I have created a new folder called Images and I post all the images into it. It works just as great as your comments. Thank again.

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              Originally posted by Iman100
              Thanks a lot for clarifying this point for me. I am new to asp.net. Now I have created a new folder called Images and I post all the images into it. It works just as great as your comments. Thank again.
              Yeah, I should have included that you can just make your own directory and store all your images there, but I didn't even think of it.

              Comment

              Working...