//Display success message (several ways) shown here
//Method 1
string st = "script language='javascript'" + "window.alert('CustomerId' :" + CustId + " deleted successfully)" + "/script";
Page.ClientScript.RegisterClientScriptBlock(GetType(),"del_successMessage", st, false);
//Method 2
//Here the Javascript function is written normally in the script tag in the Head section of the HTML page.
Page.ClientScript.RegisterStartupScript(GetType(),"Javascript", "javascript: fnShowSuccessMessage();",true);
//Both the above methods do not work if we use Update Panel as a container..see solution that works below.
I had to remove tags on the script tag in order to post it.
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(@"script language='javascript'");
sb.Append(@"alert('CustomerId :" + CustId + " deleted successfully');");
sb.Append(@"/script");
ScriptManager.RegisterStartupScript(btnDelete, GetType(), "MyJavaScript", sb.ToString(), false);