Implement a MessageBox window with ASP.NET C #
/// <summary>
/// Displays a dialog box with a message
/// </summary>
/// <param name="message"></param>
private void MessageBox(string message)
{
ScriptManager.RegisterStartupScript(Page, this.GetType(), "IDMessageBox", "window.alert('" + message.Replace("<br>", "\\n").Replace("'", "\\'") + "')", true);
}
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ButtonShowMessageBox_Click(object sender, EventArgs e)
{
string message = "Hello World!<br> I program in ASP.NET";
MessageBox(message);
}