是否可以在for
,foreach
或任何其他服务器端循环中为每次迭代显示弹出窗口?
例如,像这样:
foreach (GridDataItem item in RadGridEmps.MasterTableView.Items)
{
CheckBox ChkChange = item.FindControl("ChkChange") as CheckBox;
if (ChkChange.Checked)
{
oldEmpId = item.GetDataKeyValue("oldEmpId").ToString();
newEmpId = item.GetDataKeyValue("newEmpId").ToString();
var msg = string.Format("Change from {0} to {1}?", oldEmpId, newEmpId);
OkCancel_Popup(msg);
if (OK)
UpdateEmp(oldEmpId, newEmpId);
else if (Cancel)
//Do Nothing and go to following row
}
}
答案 0 :(得分:-1)
您是否只能使用MessageBox.Show
,如下所示
if (DialogResult.OK == MessageBox.Show(msg))
UpdateEmp(oldEmpId, newEmpId);
else
//Do Nothing