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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:52:14+00:00 2026-05-19T00:52:14+00:00

in my asp.net mark up I have a foreach loop that iterates through a

  • 0

in my asp.net mark up I have a foreach loop that iterates through a simple list. In this foreach loop I am adding a new user control and attempting to pass in the value from the loop. However, this value just wont budge and get inside that damn control! Anyone have any suggestions?

<%foreach (userInfo i in this.items)
    { %>  
        <uc1:ItemControl ID="ItemControl" runat="server" UserID='<%#Eval("userID") %>'/>
<%} %>

userID is a public property in the control, when it goes to set, the value is just literally : <%#Eval(“userID”) %>. I’ve tried #Bind and =Value but nothing seems to work.

Any help would be appreciated!

  • 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-19T00:52:15+00:00Added an answer on May 19, 2026 at 12:52 am

    Looks like the perfect use case for a repeater:

    <asp:Repeater runat="server" id="myRepeater">
       <uc1:ItemControl ID="ItemControl" runat="server" />
    </asp:Repeater>
    

    You can databind your list (this.items) to the repeater and in the code behind, in the DataBind event set the UserID property of the ItemControl control.

    The reason your approach will not work is that IDs have to be unique in a page.

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

Sidebar

Related Questions

I have the following mark up in an ASP.NET MVC view (this is a
ASP.Net 3.5 I want to create a user control that contains the ListView and
I have a ASP.NET form that has a search box, with a Go button.
I have some internal-facing ASP.NET web services that have had numerous API additions over
My asp.net page dynamically displays 207 questions (I can't control this). Each question have
I have an ASP.Net MVC 3 web application and I am adding a check
I do have some strings that contains programming code, like XHTML (asp.net markup), C#,
Folks, I have a custom WebPart (the ASP.Net variety) that has a property whose
I have an asp.net form with bunch of sections that can be expanded/collapsed and
I have a project that requires an ASP.Net app to use google credentials and

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.