在服务器端循环中为每次迭代显示Ok / Cancel弹出窗口?

时间:2015-12-04 15:10:32

标签: javascript c# asp.net asp.net-4.0

是否可以在forforeach或任何其他服务器端循环中为每次迭代显示弹出窗口?

例如,像这样:

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
    }
}

1 个答案:

答案 0 :(得分:-1)

您是否只能使用MessageBox.Show,如下所示

if (DialogResult.OK == MessageBox.Show(msg))
    UpdateEmp(oldEmpId, newEmpId);
else
    //Do Nothing