Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Sunday, 22 June 2014

Show Exception Message in java Script Alert in Code Behind


Page.ClientScript.RegisterStartupScript(GetType(), "Alert", @"<script language='javascript'>alert('" + ex.Message + @"');</script>");



Another Simple JavaScript Alert from Code Behind

ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Alert", "alert('sometext*** sucessfully');", true);

 ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Alert", "alert('sometext*** sucessfully');", true);
                    HttpContext context = HttpContext.Current;
                    context.Response.Write("<script type='text/javascript'>if(window.frameElement!=null){window.frameElement.commitPopup();}else{window.close();}</script>");
                    context.Response.Flush();
                    context.Response.End();
Please provide your feedback in the comments section above. Please don't forget to follow.