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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:33:59+00:00 2026-05-23T20:33:59+00:00

I have a nested repeater Because of that no control in my code is

  • 0

I have a nested repeater
Because of that no control in my code is visible and because of that I found out that I had to use FindControl to get the controls visible.
I want to pass on a value from a lable after a buttonclick but I’m having a hard time getting it right

The label with the value

<asp:Label ID="lblordernr" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.sid").ToString()%>'></asp:Label>

The button I use:

<asp:Button ID="btnPaid" runat="server" Text="Paid" OnClick="rlrtAdres_ItemDataBound"
                        Style="height: 26px" CssClass="knop" CommandName="btnPaid" />

RepeaterItemDataBound

protected void rlrtAdres_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    Label lblordernr = e.Item.FindControl("lblordernr") as Label;
    Repeater myRepeater = (Repeater)sender;
    Button btn = (Button)sender;
    switch (btn.CommandName)
    {
        case "btnPaid":
            MutateSold("paid", lblordernr.Text);
            break;
    }
}

I first had a normal buttonOclick control but I just dont know how to combine it with the label value and call the final method “MutateSold” for database purposes with a nested repeater and every invisible control in this repeater

protected void btnButton_Click(object sender, EventArgs e)
{
    Control myControllblordernr = FindControl("lblordernr");
    Button btn = (Button)sender;
    switch (btn.CommandName)
    {
        case "btnPaid":
            MutateSold("paid", myControllblordernr.ToString());
            break;
     }
}
  • 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-23T20:34:01+00:00Added an answer on May 23, 2026 at 8:34 pm

    You’re getting the error you posted in the title because the Click event of btnPaid expects an event handler with a signature like:

    protected void btnButton_Click(object sender, EventArgs e)

    You’re pointing it at a method that has a signature of:

    protected void rlrtAdres_ItemDataBound(object sender, RepeaterItemEventArgs e)

    If btnPaid and lblordernr are in the same ItemTemplate for the repeater, you can call FindControl on the button to get a reference to lblordernr. For example, if btnPaid is declared like this:

    <asp:Button ID="btnPaid" runat="server" Text="Paid" OnClick="btnPaid_Click"
        Style="height: 26px" CssClass="knop"  />
    

    the following code will get you a reference to lblOrderNr.

    protected void btnPaid_Click(object sender, EventArgs e)
    {
        var btnPaid = (Button)sender;
        var lblOrderNr = (Label)btnPaid.FindControl("lblordernr");
        var labelText = lblOrderNr.Text;
    
        //Do whatever else needs to be done
    }
    

    Alternatively, you can just add the value in lblOrderNr to the CommandArgument property on the button and get it right from there as well.

    <asp:Button ID="btnPaid" runat="server" Text="Paid" OnClick="btnPaid_Click"
        CommandArgument='<%# DataBinder.Eval(Container, "DataItem.sid").ToString()%>'
        Style="height: 26px" CssClass="knop" />
    
    
    protected void btnPaid_Click(object sender, EventArgs e)
    {
        var btnPaid = (Button)sender;
        var labelText = btnPaid.CommandArgument;
    
        //Do whatever else needs to be done
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nested repeater control that displays a list of data, in my
I have an ASP.NET page that uses a repeater nested within another repeater to
I have a user control nested in a repeater. Inside my user control I
I have a nested repeater control. Here is what the HTML looks like: <ItemTemplate>
I have a nested Repeater control in the ItemTemplate of another Repeater. I want
I have a gridview control nested within a repeater control. The repeater control is
I have a complex UI with several nested tables, a repeater control and several
I have a nested repeater set up but the child repeater control is not
I have a design question. I have a nested repeater structure that is 4
I am taking some code that I have used for a nested listview before

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.