网络中的错误讯息
在应用程序未运行时显示模式对话框或表单 在UserInteractive模式下不是有效的操作。指定 ServiceNotification或DefaultDesktopOnly样式显示一个 来自服务应用程序的通知。
mycode的
using System.Windows.Forms;
protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
var confirmResult = MessageBox.Show("Are you sure to delete thisitem??",
"Confirm Delete!!",
MessageBoxButtons.YesNo);
if (confirmResult == DialogResult.Yes)
{
string terminal_id = GridView2.DataKeys[e.RowIndex].Value.ToString();
selectTerminal();
deleteTerminal(terminal_id);
}
else
{
// If 'No', do something here.
}
}
答案 0 :(得分:-1)
var confirmResult = MessageBox.Show("你确定要删除thisitem ??", "确认删除!!", MessageBoxButtons.YesNo,MessageBoxIcon.None);
尝试使用:)