broken image problem

Discussion in 'ASP .Net' started by Jeff, Apr 29, 2009.

  1. Jeff

    Jeff Guest

    hi

    asp.net 3.5

    In a Web User Control I have this image tag:
    <img src="Images/normal.gif" name="link2" border="0" />

    This image tag works great when the Web User Control is used on pages on the
    root folder, like Default.aspx..
    But when .aspx is at a subfolder (like ~/Pages/) then it displays broken
    image icon for this image...

    (the Web User Controls are in the Control folder, ~/Controls/)

    what should I do to fix this problem?
     
    Jeff, Apr 29, 2009
    #1
    1. Advertising

  2. Try:

    <img src="~/Images/normal.gif" name="link2" border="0" runat="server" />

    Since it's now a server control, the ~/ will evaluate to your root directory
    no matter what directory yer in.


    "Jeff" <> wrote in message
    news:...
    > hi
    >
    > asp.net 3.5
    >
    > In a Web User Control I have this image tag:
    > <img src="Images/normal.gif" name="link2" border="0" />
    >
    > This image tag works great when the Web User Control is used on pages on
    > the root folder, like Default.aspx..
    > But when .aspx is at a subfolder (like ~/Pages/) then it displays broken
    > image icon for this image...
    >
    > (the Web User Controls are in the Control folder, ~/Controls/)
    >
    > what should I do to fix this problem?
    >
     
    William Niver, Apr 29, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charlie

    Re: Broken image problem

    Charlie, Jun 23, 2003, in forum: HTML
    Replies:
    9
    Views:
    3,790
    Wipkip
    Jun 23, 2003
  2. Steven D'Aprano

    Why are "broken iterators" broken?

    Steven D'Aprano, Sep 21, 2008, in forum: Python
    Replies:
    8
    Views:
    694
  3. Cameron Simpson

    Re: Why are "broken iterators" broken?

    Cameron Simpson, Sep 22, 2008, in forum: Python
    Replies:
    0
    Views:
    616
    Cameron Simpson
    Sep 22, 2008
  4. Fredrik Lundh

    Re: Why are "broken iterators" broken?

    Fredrik Lundh, Sep 22, 2008, in forum: Python
    Replies:
    0
    Views:
    628
    Fredrik Lundh
    Sep 22, 2008
  5. George

    Re: broken image problem

    George, Feb 25, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    552
    Hans Kesting
    Feb 27, 2009
Loading...

Share This Page