How to make this?

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
 
M

Med

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top