Dear Sir,
how to add popup windows JavaScript while value inserted in table with complaint id.
protected void Button1_Click(object sender, EventArgs e)
{
string employeeId = lblName.Text.Trim();
string message = str.Text.Trim();
string ReadOnly = ReadOnlyTextBox.Text.Trim();
string COMP_LODGE_DATE = DateTime.Now.ToString("yyy/dd/mm");
string image = "";
if (FileUpload1.HasFile)
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
if (!Directory.Exists(Server.MapPath("~/Images")))
{
Directory.CreateDirectory(Server.MapPath("~/Images"));
}
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
image = "~/Images/" + fileName;
}
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
string query = "insert_ittest1";
using (SqlConnection con = new SqlConnection(conString))
{
SqlCommand cmd = new SqlCommand(query);
cmd.Parameters.AddWithValue("@EMP_ID", employeeId);
cmd.Parameters.AddWithValue("@COMP_MESSAGE", message);
cmd.Parameters.AddWithValue("@Comp_type", ReadOnly);
cmd.Parameters.AddWithValue("@COMP_LODGE_DATE", COMP_LODGE_DATE);
cmd.Parameters.AddWithValue("@image", image);
cmd.Parameters.Add("@COMP_ID", SqlDbType.Int).Direction = ParameterDirection.Output;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
try
{
con.Open();
cmd.ExecuteNonQuery();
string COMP_ID = cmd.Parameters["@COMP_ID"].Value.ToString();
// string COMP_LODGE_DATE = DateTime.Now.ToString();
//txtrowid.Text = "" + COMP_ID;
string Message = "Complaints has been locked successfully.";
string script = "window.onload = function(){ alert('";
script += Message;
script += "');";
script += "window.location = '";
script += Request.Url.AbsoluteUri;
script += "'; }";
ClientScript.RegisterStartupScript(this.GetType(), "SuccessMessage", script, true);
}
catch (Exception ex)
{
throw ex;
}
finally
{
con.Close();
con.Dispose();
}
string comp = txtrowid.Text;
string Date = LabelD.Text;
string mob = Label1.Text;
string empid = lblName.Text;
clientsms();
}
}