Hi,
If you are using Master Pages you have to iterate through all the containers to reach the control. Hope this will help you.
protected void Button1_Click(object sender, EventArgs e)
{
ClearInputs(Page.Controls);
}
void ClearInputs(ControlCollection cs)
{
foreach (Control container in cs)
{
foreach (Control childContainer in container.Controls)
{
foreach (Control innerChild in childContainer.Controls)
{
foreach (Control control in innerChild.Controls)
{
if (control is TextBox)
{
((TextBox)control).Text = string.Empty;
Session[childContainer.ID] = ((TextBox)control).Text;
lbl_savesubmit1.Text += Session[childContainer.ID];
}
}
}
}
}
}
Thanks!!!