Hi everyone,
I'm new to asp.net and have a repeater control which contains a Hyperlink control and a large sized image. Underneath this I would like to place more hyperlink controls containing thumbnails so that when a user clicks on a thumbnail, the large image is replaced with the thumbnail image. The problem is that I don't seem to be able to create a unique id for the large image so that when the thumbnail's click event is triggered, the codebehind can use the findcontrol method to replace the large image's url. Here is the code.
<td class="ImageCell" rowspan="4">
<asp:HyperLink ID="myImg" runat="server" NavigateUrl='<%# GetLargeImage(convert.tostring(Eval("Image_1"))) %>'
imageurl='<%# FormatImage(convert.tostring(Eval("Image_1"))) %>' />
<br /><br />
<asp:HyperLink ID="myImgThumb" CssClass="ImageThumb" runat="server"
imageurl='<%# FormatImageThumb(convert.tostring(Eval("Image_1")) ) %>'
NavigateUrl='<%# ReplaceImage(Eval("Image_1")) %>' />
</td>
I've done this before with javascript when there is just a single large image (id="LargeImage") by passing in the new image url to reset the large image's src parameter like so:
function swapPhoto(strBigPhoto)
{
document.images.LargePicture.src = strBigPhoto;
}
This is driving me nuts! Whenever I try to set the ID of the large picture to something recognisable (such as my database id), I get a "The ID property of a control can only be set using the ID attribute in the tag and a simple value. " error.
Please help!!!
|