how to add 50 value from textbox in array list fon button click

Posted by Shanky11 under ASP.NET on 7/20/2013 | Points: 10 | Views : 1586 | Status : [Member] | Replies : 1
i have to create a bulk mailing software
for that i need to store 5o mail id in araylist on button clk
how can i do this ???




Responses

Posted by: Nadeemshaik on: 7/20/2013 [Member] Starter | Points: 25

Up
0
Down
Add one groupbox control to form

and put textboxes which you need in groupbox control

in button click event
//groupbox name is "GpB1"

 private void button1_Click(object sender, EventArgs e)

{
ArrayList Ar = new ArrayList();
foreach (Control ctl in this.Controls)
{
if (ctl is GroupBox)
{
if (ctl.Name.ToString() == "GpB1")
{
foreach (Control ctl2 in ctl.Controls)
{
if (ctl2 is TextBox)
{
Ar.Add(ctl2.Text);
}
}
}
}
}
}


Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response