locked
RepeaterCommandEventArgs get related controls RRS feed

  • Question

  • User-1044034148 posted

    Hi i have a repeater with several textboxes, when the button is clicked for the row in RepeaterCommandEventArgs i need to access the related texboxes so i can get the values, how can i do this?


    protected void rptAddressList_Command(object sender, RepeaterCommandEventArgs e)
            {
                if (e.CommandName == "select")
                {
                    //get the related controls for the selected row???

                }
            }

    Wednesday, December 8, 2010 9:02 AM

Answers

  • User-1360095595 posted

    Try like this:

    TextBox tb = e.Item.FindControl("TextBox1") as TextBox;
    if (tb != null)
    {
        // Use tb here
    }


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 8, 2010 9:11 AM