To use windows confirm message box in web form at first add window namespace in your cs file.
if (gvOrder.Rows.Count > 0)
{
dia = System.Windows.Forms.MessageBox.Show("Previous Order Is Not Placed Yet.Do U want to Discard Order? ", "DELETE?", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.ServiceNotification);
if (dia == System.Windows.Forms.DialogResult.Yes)
{
//Place Your Code Here
}
}
else
{
//Place Your Code Here
}
using System.Windows;
Then add code given below to your desired place.
System.Windows.Forms.DialogResult dia = System.Windows.Forms.DialogResult.Yes;
{
dia = System.Windows.Forms.MessageBox.Show("Previous Order Is Not Placed Yet.Do U want to Discard Order? ", "DELETE?", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.ServiceNotification);
if (dia == System.Windows.Forms.DialogResult.Yes)
{
//Place Your Code Here
}
}
else
{
//Place Your Code Here
}
Muy Ăștil! Funciona perfect! Gracias!
ReplyDeletevery helpful
ReplyDeletethank you so much..
ReplyDelete