| Author: LakshmiRameshCherukuri 21 Jul 2008 | Member Level: Silver | Rating: Points: 6 |
Hi,
I do have come across similar situation in my previous proj... But I didn't used datarowbound event... instead I have passed it as parameter in the javascript itself... To the ChangeImage function I passed the Image ID.. similarly you can pass your Div ID.. hope it works for u..
function ChangeImage(i) { var newImagePath = document.getElementById(i).src; document.getElementById('NewImage').src = newImagePath; }
<ItemTemplate> <table border="1"> <tr> <td style="width: 11px"> <a href="" id="aImg" runat="server" > <img src='<%# "~/Files/" + DataBinder.Eval(Container.DataItem, "ProductImage") %>' runat="server" onclick="ChangeImage(id);" id="ProductImage" alt="" height="100" width="100" /></a> </td> </tr> </table> </ItemTemplate>
Regards, Lakshmi Ramesh
|