protected void CancelBtn_Click(object sender, EventArgs e) { string connetionString; SqlConnection cnn; connetionString = @"Data Source=DESKTOP-NCLVKS1;Initial Catalog=E-Employment ;User ID=sa;Password=allohomora"; String sql; cnn = new SqlConnection(connetionString); SqlCommand command, command1; cnn.Open(); sql = "Delete Application where ApplicationId=@appid"; command = new SqlCommand(sql, cnn); HiddenField appid = (HiddenField)VAJFormView.FindControl("ApplicationId"); command.Parameters.AddWithValue("@appid", appid.Value); command.ExecuteNonQuery(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Application Cancelled')", true); cnn.Close(); Response.Redirect("JobsSeeker.aspx"); }