我循环执行列表以检查是否为false,这时会弹出一条消息,显示更新或删除。 但是,循环后仅弹出消息框。满足条件后如何立即弹出?
我的编码如下:
foreach (var checkDist in distinctList) //loop the record
{
if (tbl == null)
{
string insertRst = TodoInsert();
}
else
{
string message = "CompanyNo: " + Dcompany + " with Location: " + Dloc + " found in database. Do You want to overwrite?";
ScriptManager.RegisterClientScriptBlock(this.Page,Page.GetType(),"Msg","confirm('" + message +"')",true);
string confirmValue = Request.Form["confirmValue"];
if (confirmValue == "Yes")
{
string value = "YES";
}
else
{
string value = "NO";
}
}
}