Question

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" />
Was it helpful?

Solution

Try resolving it from the root:

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

Don't forget the runat attribute.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top