New Website Porject with UserControls adn cannot see images?

Discussion in 'ASP .Net' started by Guest, May 9, 2007.

  1. Guest

    Guest Guest

    First, I am using VS2005 with windows XP. I am having an issue where I cannot
    see the images in my usercontrols or the ASPX pages they are dropped onto
    (the ASPX pages are on the root of the site for now). Indies my user control
    I am using a standard html img tag:
    <img src="/images/imageName.jpg" alt="" title="Test"/>
    Here is the path structure
    c:\websites\NewSite
    Under NewSite we have these folders
    Images
    UserControls
    The usercontrol is in the UserControls folder. if I change the src to
    src="../images/imageName.jpg". I can see the images int he UC, but not when I
    drop it on an ASPX page int he root of the site. Also, I cannot see the
    images, when on an ASPX page if I keep the scr the same as above. If I change
    the scr to src="images/imageName.jpg" I can then see the images in the ASPX
    page, but obviously not on the userControl. I have tried creating an ASP.Net
    web application, just a website project, and have changed what I use for the
    web server (meaning I have created a site on my 2003 server and have pointed
    the app to look at the site. I have also tired using the built in web server
    with VS2005).

    If I use src="/images/imageName.jpg" the site builds OK and I can see the
    images in the brwoser, but not in VS2005. I have tried using ~ in front of
    the /, but no go there. I have read Scott's blog on how to get this to work,
    but it didn’t work for me. Perhaps I am not setting up my environment
    correctly. Thanks to all who may reply.

    Daniel
     
    Guest, May 9, 2007
    #1
    1. Advertisements

  2. Guest

    Guest Guest

    Sorry for the double post. My broswer crashed the first time and I didn't
    think it made it. Again, sorry.

    Daniel
     
    Guest, May 9, 2007
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.