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 7528649
In Process

The Archive Base Latest Questions

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

i need to find a control in a repeater in my asp.net application. At

  • 0

i need to find a control in a repeater in my asp.net application.

At the moment I’m using FindControl("IdOfControl") and this is working well.

But I need to find a control by its type (ImageButton).

My current code:

For Each rptItem As RepeaterItem In myRepeater.Items
    Dim imgBtn As ImageButton = TryCast(rptItem.FindControl("myImageBtn"), ImageButton)
    AddHandler imgBtn.Click, AddressOf imgBtn_Click
Next

I’m searching for something like that:

For Each rptItem As RepeaterItem In myRepeater.Items
    Dim imgBtn As ImageButton = TryCast(rptItem.FindControl(TypeOf ImageButton), ImageButton)
    AddHandler imgBtn.Click, AddressOf imgBtn_Click
Next

Can anybody help?

  • 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-30T04:26:26+00:00Added an answer on May 30, 2026 at 4:26 am

    Try this

    your requirement

    For Each ri As RepeaterItem In myRepeater.Items
        For Each cn As Control In ri.Controls
            If cn.[GetType]() = GetType(ImageButton) Then
                Response.Write("ss")
                Response.Write(vbLf)
            End If
        Next
    Next
    
    e.g
        For Each cn As Control In form1.Controls
            If cn.[GetType]() = GetType(ImageButton) Then
                Response.Write("ss")
            End If
        Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m using asp 2.0, I need an requirement for sorting the repeater control.
I use asp.net and c#4. I have a repeater within inside a HyperLink Control.
I need to insert a user control into a repeater <asp:Repeater runat=server ID=rptAdditionalPages> <ItemTemplate>
I have an Asp.Net repeater, which contains a textbox and a checkbox. I need
I need to make graph control in WP7 Mango, but can't find anything suitable
I need to find a flexible solution for access control in PHP. In the
I need to find the mode EXE/DLL was build looking at its headers. (Using
I'm new to this ASP.NET stuff. In my page I have a Datalist with
I need to find a child control in a Windows Forms panel. I was
This is a followup from Populating DropDownList inside Repeater not working . I'm adding

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.