Clear text in All Text Box Controls
Reset the all text box Control by using Following FunctionUsage : Resetfromcontrol(this);
Function :
public void Resetfromcontrol(Control parent)
{
try
{
foreach (Control c in parent.Controls)
{
if (c.Controls.Count > 0)
{
Resetfromcontrol(c);
}
else
{
switch (c.GetType().ToString())
{
case "System.Web.UI.WebControls.TextBox":
((TextBox)c).Text = "";
break;
}
}
}
}
catch
{
}
}
Comments
Post a Comment