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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:02:34+00:00 2026-05-26T08:02:34+00:00

I am binding a Repeater . Each row (is that the right word?) in

  • 0

I am binding a Repeater. Each row (is that the right word?) in the Repeater has a Button and a HiddenField. How do I determine the Value of the HiddenField based on which Button was clicked?

Code behind for Button’s OnClick event:

protected void btnButton1_Click(object sender, EventArgs e)
{
    Button btnButton1 = (Button)sender;        
    // how do i get this row's HiddenField Value?
}

edit: the CommandArgument suggestion from Pleun works but I am still having issues. I need to find the row(?) in the Repeater that the Button belongs to as there is also a TextBox in each row and I would need its value. So ideally I want to get that row and go FindControl(“TextBox1”) etc etc. Sorry, should have stated that in my initial question

  • 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-26T08:02:35+00:00Added an answer on May 26, 2026 at 8:02 am

    What I like to do is add a CommandArgument to the button. In this code its an imagebutton but the idea is the same. So also no need for an extra hidden field.

    <asp:ImageButton ID="btnMail" ImageUrl="~/imgnew/prof/sendlink.png" 
    CommandArgument='<%# Eval("id")%>'
    

    And in the _Click event do

     string id = ((ImageButton)sender).CommandArgument;
    

    Update:

    If you need all the data, you need a different event. The data in the repeater is available as Item in

    RepeaterCommandEventArgs 
    

    in the Command event (RepeaterCommandEventArgs)

    for handling the Command event see this example
    http://www.asp.net/data-access/tutorials/custom-buttons-in-the-datalist-and-repeater-cs
    or
    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeatercommandeventargs.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater which has a hidden field of Parking_ID <asp:HiddenField Value='<%# Eval(Parking_ID)
I have a Flex repeater that has a complex item template. When a checkbox
A repeater control is bound to array of items with class that has boolean
I have a repeater and am binding a List<Event> to it. An Event has
I have a DropDownList inside a repeater control in an ASP.NET page that has
I am trying to pass values within a repeater binding them to a button
I'm binding a currency value inside a repeater with: <asp:TextBox runat=server ID=amount Text='<%#Eval(amount,{0:c})%>' />
I have a dataset that i am binding to a repeater. The GetXML() of
I've never had to do this, but I'm binding a repeater to a generic
In a repeater control I've Eval binding as: <%#Eval(PubDate, {0:dd-MMM-yyyy})%> But date time format

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.