redirection doesn't show logo (red cross)

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
 
H

Holg

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
 
G

Gregory A. Beamer

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,
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top