Portal Engine
Version 3.x > Portal Engine > ImageURL not resolving correctly in master page View modes: 
User avatar
Member
Member
chris-ricochetpartners - 10/15/2008 1:40:55 PM
   
ImageURL not resolving correctly in master page
Hi,

I have created a simple webpart with an asp:HyperLink that I want to include in my Master Page. When I navigate to the default.aspx page, the ImageURL does not resolve correctly. The Navigate URL Does resolve correctly however.

WebPart Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="logo.ascx.cs" Inherits="CMSWebParts_Ricochet_logo" %>
<asp:HyperLink ID="lnkHome" runat="server" ImageUrl="~/App_Themes/RicochetPartners/images/RIC_logo_blk.gif" NavigateUrl="~/default.aspx" />

The ImageUrl is resolving to CMSPage/App_Themes... instead of App_Themes.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/16/2008 3:11:02 AM
   
RE:ImageURL not resolving correctly in master page
Hi,

It seems that the HyperLink tag is not resolving the URL correctly. When using the simple IMG element everything works fine.

You can try to resolve the URL of the image in the code behind using CMS.GlobalHelper.UrlHelper.ResolveUrl(string) method and then pass the whole URL to the hyperlink element.


Best Regards,
Juraj Ondrus