Imran Pervez

Imran Pervez

  • NA
  • 45
  • 0

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)