MessageBox.Show("text", "title", MessageBoxButtons.OK, MessageBoxIcon.Warning);
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
}
MessageBox.Show("Content", "Title", MessageBoxIcon.Error)
//MessageBox.Result
DialogResult result = MessageBox.Show("Do you like cats?", "Yes or No?", messageBoxButtons.YesNoCancel);
if (result == DialogResult.Yes)
;
else if (result == DialogResult.No)
;
else
;
string message = "Simple MessageBox";
string title = "Title";
MessageBox.Show(message, title);
DialogResult result = MessageBox.Show("Do you want to save changes?", "Confirmation", MessageBoxButtons.YesNoCancel);
if(result == DialogResult.Yes)
{
//...
}
else if (result == DialogResult.No)
{
//...
}
else
{
//...
}
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);