string message = "Simple MessageBox";
MessageBox.Show(message);
string message = "Do you want to close this window?";
string title = "Close Window";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show(message, title, buttons);
if (result == DialogResult.Yes) {
this.Close();
} else {
// Do something
}
string message = "Do you want to abort this operation?";
string title = "Close Window";
MessageBoxButtons buttons = MessageBoxButtons.AbortRetryIgnore;
DialogResult result = MessageBox.Show(message, title, buttons, MessageBoxIcon.Warning);
if (result == DialogResult.Abort) {
this.Close();
}
elseif(result == DialogResult.Retry) {
// Do nothing
}
else {
// Do something
}
string message = "Simple MessageBox";
string title = "Title";
MessageBox.Show(message, title);
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);