Search code examples
c#asp.netalert

How to display an alert box from C# in ASP.NET?


I am using a detail-view and would like to display an alert-box at the end of my code block that says:

Thank you! Your data has been inserted successfully.

Is there a simple way to do this from the C# code behind of my ASP.NET web pages?


Solution

  • After insertion code,

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