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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:15:36+00:00 2026-06-09T06:15:36+00:00

This one might be simple, but here it is anyway. I have a List<Object>

  • 0

This one might be simple, but here it is anyway.

I have a List<Object> that I bind to a repeater. The repeater binds all of the fields to textboxes except Id. In my web page, whenever a user adds a new item, I create a new Object in my list with a unique Id and rebind my repeater.

At a certain point in my code, I am trying to read the textbox controls from the repeater and put them into my List<Object>. However, I need access to the Id field to know which List item to insert into. How can I get the specific Id while I’m going through the repeater?

I know I can just create a hidden field with the Id in the repeater control and get it that way, but is there a cleaner way to do this?

Example:

if (DependentRptr.Items.Count > 0)
{
    for (int count = 0; count < DependentRptr.Items.Count; count++)
    {
        int did = (form.UserId + (count + 1)); //I'm trying to get the id of this field here.
        ...get control info...

        var temp = AddedDependents.ToList().Find(p => p.Id == did); //here is where I search with the id
    }
}
  • 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-06-09T06:15:37+00:00Added an answer on June 9, 2026 at 6:15 am

    A Repeater is actually considered as a read-only control.

    It is one of the simplest built-in data-bound controls.

    It does not support actions like editing, inserting, deleting out of the box. If you want to use one of these actions in a repeater, you would have to write custom code to accomplish it. Even paging and sorting is not supported out of the box using a Repeater.

    Therefore, there’s no better way to accomplish your requirement while using a Repeater control, so a HiddenField would be a good way to fulfill your requirement.

    However depending on your specific needs, you should consider using another data-bound control.

    For example, the ListView control is also based on templates like the Repeater but it also supports common actions like editing, inserting and deleting

    A ListView control contains the DataKeyNames property used to keep track of the ID’s of each row

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

Sidebar

Related Questions

This might be a simple one, but since I don't have much knowledge about
This might be a simple one but here goes: I'm implementing an excel downloadable
This might be simple one but I am finding it very difficult to work
This is an odd question. But here goes. I have object X, which gets
This might be one of the more difficult questions I've asked, but I have
This question might belong on one of the other trilogies, but it sorta seemed
This might be an easy one, but I'm not really experienced with sql. I
It might be very simple but I think I am missing something. I have
I know this one must be a simple one for the jQuery gurus here,
This sounds like a why would you do that? sort of question, but here

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.