//call this function after completion of insert query
ClearInputs(Page.Controls);
private void ClearInputs(ControlCollection ctrls)
{
foreach (Control ctrl in ctrls)
{
if (ctrl is TextBox)
{
((TextBox)ctrl).Text = string.Empty;
}
else if (ctrl is DropDownList)
{
((DropDownList)ctrl).ClearSelection();
}
ClearInputs(ctrl.Controls);
}
}
ClearInputs(Page.Controls);
private void ClearInputs(ControlCollection ctrls)
{
foreach (Control ctrl in ctrls)
{
if (ctrl is TextBox)
{
((TextBox)ctrl).Text = string.Empty;
}
else if (ctrl is DropDownList)
{
((DropDownList)ctrl).ClearSelection();
}
ClearInputs(ctrl.Controls);
}
}
0 comments:
Post a Comment