clear()
is a function here. You cannot call the function inside the class directly. You can only declare a function in the class. A function can be called inside a function. Do a little modificaiton in your coding. Here it is:
public partial class contact_us : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
}
public void clear()
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}
protected void image_Click(object sender, ImageClickEventArgs e)
{
MailMessage mail = new MailMessage();
mail.To.Add("xyz@gmail.com");
mail.From = new MailAddress(TextBox2.Text);
mail.Subject = "Inquiry regarding Umang Party Plot";
mail.Body = TextBox4.Text;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new System.Net.NetworkCredential("xyz@gmail.com", "12345");
smtp.EnableSsl = true;
smtp.Send(mail);
Response.Write("<script language="'javascript'">alert('Your Inquiry has been Successfully send.');location.href('contact_us.aspx');</script>");
clear();
}
}
--Amit