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
 

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

Similar Threads

Event 2
Fire Event 1
Bubble Event 2
Override Css Class 1
Find Child Control 2
Gridview inside gridview problem 1
Class Property 2
Custom Control 3

Back
Top