ImageButton.ImageUrl fails in different paths - same User control/Macro - Umbraco Only Options
jhildeman
Posted: Friday, June 20, 2008 11:51:53 PM

Rank: Enthusiast

Joined: 6/12/2007
Posts: 35
Location: Appleton, WI USA
I have the following code in a User control. This user control works fine at all levels of a standard asp.net 2.0 site (non-Umbraco). This same user control fails to render properly under Umbraco 3.0.3 (i.e. Broken image links) unless it placed on a "page" in the root of the site. The image buttons function fine, they just don't render correctly. I am wrapping the UserControl with the same macro on all pages and inserting it into the content for each page via the Rich Text editor. Here are some sample links:
Broken Link | Working Link


Code:
<asp:Panel id="EditorToolbarPanel" BackImageUrl="~/usercontrols/OnlineRegistration/Images/ToolbarBackground.png" style="padding:4px;" runat="server">
    <asp:ImageButton ID="ToolbarViewList" ImageUrl="~/usercontrols/OnlineRegistration/Images/ViewList.png" runat="server" ToolTip="View list" OnClick="ToolbarViewList_Click" />
    <asp:Image ID="Sep1" runat="server" ImageUrl="~/usercontrols/OnlineRegistration/Images/sep.png" />
    <asp:ImageButton ID="ToolbarAdd" ImageUrl="~/usercontrols/OnlineRegistration/Images/add.png" runat="server" OnClick="ToolbarAdd_Click" ToolTip="Add new" />
    <asp:ImageButton ID="ToolbarSave" ImageUrl="~/usercontrols/OnlineRegistration/Images/save.png" runat="server" OnClick="ToolbarSave_Click" ToolTip="Save" />
    <asp:ImageButton ID="ToolbarDelete" ImageUrl="~/usercontrols/OnlineRegistration/Images/delete.png" runat="server" OnClick="ToolbarDelete_Click" OnClientClick="if(confirm('Are you sure you want to delete this?')){}else{return false}" ToolTip="Delete" />
    <asp:Image ID="Sep2" runat="server" ImageUrl="~/usercontrols/OnlineRegistration/Images/sep.png" />
  </asp:Panel>


Any ideas? This is such common code with such an odd behavior. I have also tried relative urls, such as "images/ToolbarBackground.png" and even absolute paths like "http://.../Images/ToolbarBackground.Png" both of which behave the same way.
gpolitis
Posted: Friday, October 24, 2008 3:54:23 PM
Rank: Newbie

Joined: 10/22/2008
Posts: 2
Location: Greece
Hi jhildeman, were u able to work around this issue? I have the same problem.
jhildeman
Posted: Friday, October 24, 2008 6:42:49 PM

Rank: Enthusiast

Joined: 6/12/2007
Posts: 35
Location: Appleton, WI USA
I ended up with the following solution...

Code:
  <asp:Panel id="EditorToolbarPanel" BackImageUrl="/usercontrols/OnlineRegistration/Images/ToolbarBackground.png" style="padding:4px;" runat="server">
    <asp:ImageButton ID="ToolbarViewList" ImageUrl="/usercontrols/OnlineRegistration/Images/ViewList.png" runat="server" ToolTip="View list" OnClick="ToolbarViewList_Click" />
    <asp:Image ID="Sep1" runat="server" ImageUrl="/usercontrols/OnlineRegistration/Images/sep.png" />
    <asp:ImageButton ID="ToolbarAdd" ImageUrl="/usercontrols/OnlineRegistration/Images/add.png" runat="server" OnClick="ToolbarAdd_Click" ToolTip="Add new" />
    <asp:ImageButton ID="ToolbarSave" ImageUrl="/usercontrols/OnlineRegistration/Images/save.png" runat="server" OnClick="ToolbarSave_Click" ToolTip="Save" />
    <asp:ImageButton ID="ToolbarDelete" ImageUrl="/usercontrols/OnlineRegistration/Images/delete.png" runat="server" OnClick="ToolbarDelete_Click" OnClientClick="if(confirm('Are you sure you want to delete this?')){}else{return false}" ToolTip="Delete" />
    <asp:Image ID="Sep2" runat="server" ImageUrl="/usercontrols/OnlineRegistration/Images/sep.png" />
  </asp:Panel>
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.