我正在使用响应。重定向后,我删除了一个特定的用户有网格填充最新的值。但它会给我误差lblError。Text=无法计算表达式,因为代码已优化或本机帧位于调用堆栈的顶部。
由于这个错误,我没有得到删除的确认,任何帮助将是感激的
代码:-如果分。Checked == true){
isDeleted=oFTE.DeleteUserRoleMapDetails(row.Cells[1].Text);
if (isDeleted == 0)
{
lblError.Visible = true;
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "User Role Map deletion failed.";
}
else if (isDeleted == 1)
{
lblError.Visible = true;
lblError.ForeColor = System.Drawing.Color.Red;
//Response.Redirect("userRoleMap.aspx");
Session["Msg"] = "User Role Map deleted successfully.";
Response.Redirect("userRoleMap.aspx",false);
//lblError.Text = "User Role Map deleted successfully.";
break;
}
}
if (iRowCount == gridViewResults.Rows.Count)
{
lblError.Visible = true;
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "Please select a row to delete.";
}
}
}
}
catch (Exception ex)
{
lblError.Visible = true;
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = ex.Message.ToString();
}
}
blError.Text=Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
仅在本机调用中暂停调试器时显示在Locals/Watch窗口中。这不是一个阻止页面加载的实际错误。也许,问题是您在代码中设置了一个断点,并且请求在您恢复执行之前从浏览器超时了?
消息来自调试器。在不使用调试器的情况下运行应用程序,查看真正的错误。