Write following function in the common class.
public class MyClass
{
public static void ResetTextBoxes(Control oControl)
{
foreach (Control c in oControl.Controls)
{
if (c is TextBox)
{
TextBox t = (TextBox)c.FindControl(c.ID);
t.Text = string.Empty;
}
if (c.HasControls())
{
ResetTextBoxes(c);
}
}
}//ResetTextBoxes
}
Call the above function like this
MyClass. ResetTextBoxes(this);
You should ensure that you are using following namespace in the class file where you are writing this function
using System;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Web;