Tuesday, June 7, 2022

Javascript alert in ASP.NET C# - By Microsoft

    System.Text.StringBuilder sb = new System.Text.StringBuilder();

                sb.Append(@"<script language='javascript'>");

                sb.Append(@"alert('Batch End Date cannot be National Holiday...');");

                sb.Append(@"</script>");

                ScriptManager.RegisterStartupScript(this, this.GetType(), "JSCR", sb.ToString(), false);

=========================================

 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);

=================================

By Microsoft

ClientScript.RegisterStartupScript(this.GetType(), "message",    "alert('The products have been updated.');", true);

No comments:

Post a Comment