Forums - C# Corner

Forum guidelines

Message Box in asp.net/ c#

Oct 11 2010 7:18 AM


i want to show message in messagebox "Data Saved successfully" when click submit botton
i use below code but message box not show plz send me solution for this
protected void btnSaveUpdate_Click(object sender, EventArgs e)
{

objclscp_BlockFngoTargets.Insert(
);
MessageBox(
"Data Saved Successfully !");

}
private void MessageBox(string msg)
{
Label lbl = new Label();
lbl.Text =
"<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "')</script>";
Page.Controls.Add(lbl);
}

 
but above code not give any responce
i also use one more code but same problem
private void MessageBox(string message)
{
if (!string.IsNullOrEmpty(message))
{
Response.Write("<script type=\"text/javascript\" language=\"javascript\">");
Response.Write("alert('" + message + "');");
Response.Write("</script>");
}
}


  
  
 

Answers (10)

File APIs for .NET – 25% off Aspose.Total
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more! Use coupon code HOL2016PSB