public void CleareAllcontrolsRecursive(Control container)
{
foreach (var control in container.Controls)
{
if (control is TextBox)
{
((TextBox)control).Text = string.Empty;
}
if (control is DropDownList)
{
((DropDownList)control).SelectedValue = "0";
}
if (conntrol is CheckBox)
{
((CheckBox)control).Checked = false;
}
}
}
call this method button click ,after inserting the data...
CleareAllcontrolsRecursive(panel1);
in your body tag...contails "panel1" tag
<asp:form id="form1" runat="server" xmlns:asp="#unknown">
<asp:panel id="panel1" runat="server">
....controls tags...