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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:04:59+00:00 2026-06-09T03:04:59+00:00

I have a repeater as shown below. How to get the Report ID in

  • 0

I have a repeater as shown below. How to get the Report ID in code behind (from the expression inside hiddenContent2) ?

The expression is

<%# Eval("ReportID") %>

Note: I prefer a method that does not use “FindControl”.

ASP.NET

<asp:Repeater ID="rptReports" runat="server">
    <HeaderTemplate>
        <div></div>
    </HeaderTemplate>
    <ItemTemplate>
        <div id="repeaterIdentifier" class="repeaterIdentifier">
            <div id="reportTitle" class="reportTitle">
                <%# Eval("Title") +":" %>
            </div>
            <div id ="reportFrequency" class="reportFrequency">
                <%# " Frequency - "+ Eval("Frequeny") %>
            </div>
        </div>

        <div class="reportContent">
            <div class="repeaterLine">
                <asp:TextBox ID="txtEmailRecipients" runat="server" class="textEdit" Text='<%# Eval("Recipients")%>' TextMode="MultiLine"></asp:TextBox>
            </div>
        </div>

        <div id="hiddenContent2"> 
             <%# Eval("ReportID") %>
        </div>
    </ItemTemplate>
</asp:Repeater>

Code Behind

protected void Save_Click(object sender, EventArgs e)
{
    foreach (RepeaterItem item in rptReports.Items)
    {
        foreach(Control c in item.Controls)
        {
            string test1 = c.ID;
            Type t = c.GetType();
        }
        string emails = ((TextBox)item.Controls[1]).Text;
    }
}
  • 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-09T03:05:00+00:00Added an answer on June 9, 2026 at 3:05 am

    Try this,

    foreach (RepeaterItem item in rptReports.Items)
    {
        Label lblReportID= (Label)item.FindControl("lblReportID");
        string ReportID = lblReportID.Text;
    }
    

    If you are using “div”, then try this:

     <div id="hiddenContent2" runat="server"> 
            <%# Eval("ReportID") %>
     </div>
    
     foreach (RepeaterItem item in rptReports.Items)
     {
         System.Web.UI.HtmlControls.HtmlGenericControl hiddenContent2 = (System.Web.UI.HtmlControls.HtmlGenericControl)item.FindControl("hiddenContent2");
         string ReportID = hiddenContent2.InnerHtml;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Repeater Control as shown below. <asp:Repeater ID=rptCategory runat=server> <HeaderTemplate> <h2 class=art-logo-text style=margin-bottom:
I have Repeater Control and in that i have code like this <div runat=server
I have a user control with linkbuttons (used for paging) and a repeater inside
I have a file containing the data shown below. The first comma-delimited field may
I have a simple repeater inside an UpdatePanel in my ASP.NET page. This repeater
Basically the question is: how do i get the ImageID from a repeater so
I have a repeater which fetches data from a database and shows some labels
I have a repeater trying to get multiple data to display. which includes a
I have some code that prints out databse values into a repeater control on
I am have this query below that is a drop down for year (from

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.