Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6215527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:04:26+00:00 2026-05-24T07:04:26+00:00

I am using a repeater control to show some data on my page. The

  • 0

I am using a repeater control to show some data on my page.

The repeater item template has an image and a label field.

I want that when i click the image , I get an event containing the id field of my data item.

How can I achieve this ?

Actually when I click the image i want to go to another page and want to show detailed information of my data item, in repeater i m just showing short information.

My repeater looks like this:

   <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 PhotoID in the event when i click the image.

My photo class looks like this:

 public class PhotoDC
    {     
        public byte[] ImagebyteArray { get; set; }     
        public string Name { get; set; }
        public int PhotoID { get; set; }
    }

I have been doing winform programming just started web, maybe it is easy but i m struggling to find a solution.

I somehow managed to show hand cursor when i hover the image though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:04:27+00:00Added an answer on May 24, 2026 at 7:04 am

    Try this:

    <asp:Repeater ID="itemRepeater" runat="server" OnItemCreated="itemRepeater_ItemCreated" >    
       <ItemTemplate>
          <tr>
             <td colspan="2">
                <asp:ImageButton ID="phImage" runat="server" ImageUrl='<%#"~/ImageHandler.ashx?id=" + DataBinder.Eval(Container.DataItem, "PhotoID")%>'  OnCommand="Image_Click" CommandName="ImageClick" CommandArgument='<%# Eval("PhotoID") %>' />
             </td>
             <td>
                <asp:Label ID="lblImageName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' />
             </td>
          </tr>
       </ItemTemplate>  
    </asp:Repeater>
    
    protected void Image_Click(object sender, CommandEventArgs e)
    {
        if (e.CommandName == "ImageClick"){
            //e.CommandArgument -->  photoid value
            //Do something
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using an asp:Repeater control in my .aspx page that looks similar to:
I am using an asp:Repeater control in my .aspx page that looks similar to:
I have a page on my ASP.NET site that has a Repeater control to
I have an image gallery that is created using a repeater control. The repeater
I'm using the Repeater control on my site to display data from the database.
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have a label that is using a repeater to get information form a
Im using a repeater control and a databinder to display data from the database
I'm using a repeater on my page. I want to populate this repeater based
Now am using repeater control and create three labels and corresponding textbox. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.