I am using a repeater control to display some data on my page.
The repeater element template has an image and a label field.
I want that when I click on the image, I get an event containing the id field of my data element.
How can i achieve this?
In fact, when I click on the image, I want to go to another page and want to show detailed information about my data element, in the repeater I will just show short information.
My repeater is as follows:
<asp:Repeater ID="itemRepeater" runat="server" OnItemCreated="itemRepeater_ItemCreated" > <ItemTemplate> <tr> <td colspan="2"> <asp:Image ID="phImage" runat="server" ImageUrl='<%#"~/ImageHandler.ashx?id=" + DataBinder.Eval(Container.DataItem, "PhotoID")%>' /> </td> <td> <asp:Label ID="lblImageName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' /> </td> </tr> </ItemTemplate> </asp:Repeater>
I want to get a PhotoID when I click an image.
My photography class is as follows:
public class PhotoDC { public byte[] ImagebyteArray { get; set; } public string Name { get; set; } public int PhotoID { get; set; } }
I am involved in winform programming, just running the web, it may be easy, but I'm trying to find a solution.
I somehow managed to show the cursor when I find the image.
source share