How to make this?

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am creating a custom control named Parent.

Parent has:

1. a child control named Send that has a button inside it;
2. Up to 10 child controls all of them having one textbox.

What I need is to implement something that when the button is clicked
in Send child control, it looks for all other child controls inside
Parent, gets all the textboxes values and it makes them available
through a Parent property and Event.

How can I do this?

Thanks,
Miguel
 
Insert all your child controls/textboxes into a panel and:

foreach (Control ctl in Panel1.Controls)
{
if (((TextBox)ctl.FindControl("Text1")).Text == "whatever")
{
//do something
}
}

Hope this helps.

Regards

Med
 
Back
Top