Hyperlink images randomly appearing

R

Ryan Harvey

Hi all,

I have written a web user control that contains a repeater control. the
ItemTemplate for this control is basically 6 Hyperlinks in a row, that are
dynamically allocated one of 7 gif images as the ImageURL of the Hyperlink.
When a load the page with the controls on it works fine, but sometimes the
images are broken, but if i hit refresh i get random selections of the gifs
appearing and not appearing. if i hit Back button to a page it seems to
display the whole control correctly, but if i hit refresh then not all
images display correctly. the code for the user control is below. Is there
some issue with caching of images. Im using IE 6 SP1. Is there a way round
this like using an Image control and putting a <a> tag round it manually
rather than using the asp:hyperlink object. i suspect ill get the same
probem. it has to be a hyperlink as the NavigateURL is also allocated
dynamcally.

<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="PIDisplayControl.ascx.vb"
Inherits="TestHarnessVB.PIDisplayControl"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<table cellPadding="0">
<tr>
<td align="left" width="50px" height="14px" id="SubPILabelCell"
runat="server">
<asp:Label id="lbl_SubPI" runat="server">Sub PIs</asp:Label>
</td>
<td align="left" width="300"><asp:label id="PISummaryTitle"
runat="server"></asp:label></td>
</tr>
</table>
<table>
<tr>
<td align="left" width="350">
<asp:repeater id="Repeater1" runat="server">
<ItemTemplate>
<table cellpadding="0">
<tr>
<td width="50px" height="20px" runat="server" id="SubPICheckBoxCell">
<asp:CheckBox Checked='<%# DataBinder.Eval (Container.DataItem,
"SUBPI") %>' Visible='<%# ShowSubLevelPICheckbox %>' Runat=server
ID="Checkbox1">
</asp:CheckBox>
</td>
<td width="20px" height="20px" align=center valign=middle>
<asp:HyperLink ImageUrl='<%# String.Concat
(imagePath,DataBinder.Eval (Container.DataItem,"M3COLOUR"),imageExt) %>'
Runat="server" NavigateUrl='<%# String.Concat (childPIPage,DataBinder.Eval
(Container.DataItem,"M3URL")) %>' ID="Hyperlink1">
</asp:HyperLink>
</td>
<td width="20px" height="20px" align=center valign=middle>
<asp:HyperLink ImageUrl='<%# String.Concat
(imagePath,DataBinder.Eval (Container.DataItem,"M2COLOUR"),imageExt) %>'
Runat="server" NavigateUrl='<%# String.Concat (childPIPage,DataBinder.Eval
(Container.DataItem,"M2URL")) %>' ID="Hyperlink2">
</asp:HyperLink>
</td>
<td width="20px" height="20px" align=center valign=middle>
<asp:HyperLink ImageUrl='<%# String.Concat
(imagePath,DataBinder.Eval (Container.DataItem,"M1COLOUR"),imageExt) %>'
Runat="server" NavigateUrl='<%# String.Concat (childPIPage,DataBinder.Eval
(Container.DataItem,"M1URL")) %>' ID="Hyperlink3">
</asp:HyperLink>
</td>
<td width="20px" height="20px" align=center valign=middle>
<asp:HyperLink ImageUrl='<%# String.Concat
(imagePath,DataBinder.Eval (Container.DataItem,"NCOLOUR"),imageExt) %>'
Runat="server" NavigateUrl='<%# String.Concat (childPIPage,DataBinder.Eval
(Container.DataItem,"NURL")) %>' ID="Hyperlink4">
</asp:HyperLink>
</td>
<td width="20px" height="20px" align=center valign=middle>
<asp:HyperLink ImageUrl='<%# String.Concat
(imagePath,DataBinder.Eval (Container.DataItem,"P1COLOUR"),imageExt) %>'
Runat="server" NavigateUrl='<%# String.Concat (childPIPage,DataBinder.Eval
(Container.DataItem,"P1URL")) %>' ID="Hyperlink5">
</asp:HyperLink>
</td>
<td width="20px" height="20px" align=center valign=middle>
<asp:HyperLink ImageUrl='<%# String.Concat
(imagePath,DataBinder.Eval (Container.DataItem,"P2COLOUR"),imageExt) %>'
Runat="server" NavigateUrl='<%# String.Concat (childPIPage,DataBinder.Eval
(Container.DataItem,"P2URL")) %>' ID="Hyperlink6">
</asp:HyperLink>
</td>
<td height="20px" width="20px" align="left" valign=middle>
<asp:Label Runat=server Visible='<%# ShowPercentageScore %>'
ID="Label1">
<%# DataBinder.Eval (Container.DataItem,"PERIOD_SCORE") %>
</asp:Label>
</td>
<td height="20px" width="25px" align="left" valign=middle>
<asp:Label>
<%# DataBinder.Eval (Container.DataItem,"PERIOD_CODE") %>
</asp:Label>
</td>
<td height="20px" width="135px" nowrap align="left" valign=middle>
<asp:Label>
<%# DataBinder.Eval (Container.DataItem,"PERIOD_NAME") %>
</asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:repeater>
</td>
</tr>
</table>


Thanks
Ryan Harvey


Sub PIs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top