我正在尝试提供一个确定取消弹出窗口“如果”gridview 没有行,并且我认为这将像客户端脚本一样工作,但是当我点击确定时,控件会跳过该方法的其余部分。无论如何我可以执行此验证或警报并将控件移动到下一条语句吗?
protected void btnRunD_Click(object sender, EventArgs e)
{
try
{
int iESStatus = 0;
int iRunStatus = 0;
ApplicationUser au = (ApplicationUser)Session["ApplicationUser"];
if (UploadFileGrid.Rows.Count <= 0)
{
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "confirm('No new data files have been uploaded. Are you sure you want to run EYDS Processing Module?');",
//true);
}
if (au.RoleID != 2) //RoleID is not Admin!
{
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "alert('You do not have enough privileges to use this functionality!');",
true);
}
else
{.........}
}
我遇到困难的部分在这里:
我正在尝试提供一个好的取消弹出窗口'如果'gridview没有行
if (UploadFileGrid.Rows.Count <= 0)
{
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "err_msg", "confirm('No new data files have been uploaded. Are you sure you want to run?');",
}