Pregunta

I am having problem with displaying a banner image in ascx control. Image is displayed properly in design time under VS 2010, however it is not displayed neither in ASP.NET Development Server nor in IIS 7. I've tried to access this image from web browser and it is displayed so this is not a rights issue I guess.

This problem affects only images this ascx control, when I put the same image on for example Default.aspx page it is displayed properly.

Everything works fine on my client's machine. I am run out of ideas, could you help?

<%@ control language="C#" autoeventwireup="true" inherits="CustomControls_HeaderWork, App_Web_y1ie2anf" %>
<%@ Register Src="Languages.ascx" TagName="Languages" TagPrefix="uc1" %>
<img src="../App_Themes/ThemeBlue/Images/banerA.jpg" />
¿Fue útil?

Solución

Try resolving it from the root:

<img src="~/App_Themes/ThemeBlue/Images/banerA.jpg" runat="server" />

Don't forget the runat attribute.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top