I have a menu, and each menu item has an image. This is a piece of code from one element:
<script type="text/javascript"> </script> <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Menu.ascx.cs" Inherits="UserControls_Menu" %> <ul id="navmenu"> <li><a id="default" runat="server" href="~/Default.aspx" onmouseover="changeImage('sideBar_Menu1_Image7', 'Images/Calendar32x32.png');" onmouseout="changeImage('sideBar_Menu1_Image7', 'Images/Calendar24x24.png');"> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td style="height: 32px; width: 32px"> <asp:Image ID="Image7" runat="server" ImageUrl="~/Images/Calendar24x24.png" /> </td> <td style="vertical-align: middle"> <asp:Label ID="Label6" runat="server" Text="CALENDAR" meta:resourcekey="Label6Resource1"></asp:Label> </td> </tr> </table> </a></li>
When I launch my application, when I load images in the menu in the root folder, but when I go somewhere else, they will no longer load. Is there any way to do this with js? I would not want so many css classes to start to do now to solve the problem.
LATER CHANGE: the solution consists of the BL project, the Jobs project and a website called CRM ... when it runs on the local machine, it works fine if I write /CRM/Images/Image.png, but it doesn’t work when publishing ... if I write /Images/Image.png, it does not work on localhost, but it works when publishing ... I will not know the path, since it will be deployed to more clients, each of them will have a different path. .. but I found a solution and below code
thanks
source share