redirection doesn't show logo (red cross)

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Hi,

i want to redirect to a page (newpage.aspx) which contains a logo. With my
code below, the new page is open but without the logo (red cross).

the sending page contains:
<script language="javascript" type="text/javascript">
window.location.href = 'newpage.aspx';
</script>

the newpage.aspx contains:
<asp:Image ID="Image1" runat="server" ImageUrl="~/logo.gif" />

The file logo.gif is in the same directory as the file newpage.aspx.

Thanks for help.
Ben
 
i want to redirect to a page (newpage.aspx) which contains a logo. With my
code below, the new page is open but without the logo (red cross).

the sending page contains:
<script language="javascript" type="text/javascript">
window.location.href = 'newpage.aspx';
</script>

the newpage.aspx contains:
<asp:Image ID="Image1" runat="server" ImageUrl="~/logo.gif" />

The file logo.gif is in the same directory as the file newpage.aspx.

"~/logo.gif" means the image is in your web root folder? If it is then it
should be shown.
Right click on the X and copy the used URL for the images.

holg
 
Ben said:
Hi,

i want to redirect to a page (newpage.aspx) which contains a logo.
With my code below, the new page is open but without the logo (red
cross).

the sending page contains:
<script language="javascript" type="text/javascript">
window.location.href = 'newpage.aspx';
</script>

the newpage.aspx contains:
<asp:Image ID="Image1" runat="server" ImageUrl="~/logo.gif" />

The file logo.gif is in the same directory as the file newpage.aspx.

If it is in the same folder, why are you using the ~. Is this on a
master page? If not, get rid of the ~ and you should be fine.

FYI: ~ is a special character meaning application route. There is a
routine (forget the name) that maps this to the app route. It is in one
of the base classes for controls, which is why ~ does not work in some
other contexts.


Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top