hello Experts
Every developer need Clear Control Class After Submitted Data Earlier some developer use
like this,
textid.text=""; But This is new one........... EveryOne can use this just open class in appcode.
public int cleartextbox(Control primary)
{
foreach (Control _ChildControl in primary.Controls)
{
if ((_ChildControl.Controls.Count > 0))
{
cleartextbox (_ChildControl);
}
else
{
if (_ChildControl is TextBox)
{
((TextBox)_ChildControl).Text = string.Empty;
}
if (_ChildControl is DropDownList)
{
((DropDownList)_ChildControl).Text = string.Empty;
}
if (_ChildControl is RadioButtonList)
{
((RadioButtonList)_ChildControl).Text = string.Empty;
}
if (_ChildControl is CheckBoxList)
{
((CheckBoxList)_ChildControl).Text = string.Empty;
}
if (_ChildControl is CheckBox)
{
((CheckBox)_ChildControl).Text = string.Empty;
}
}
} return 0;
}
Call it on Aspx.cs private int cleartext()
{ //call the class that you have created in appcode and create the object
clearclass obj=new clearclass();
retrun obj.clearControls(this);
}