グリッドビューに行がなく、これはクライアントスクリプトのように機能すると思いましたが、[ok]を押すと、コントロールはメソッドの残りの部分をスキップします。とにかく、この検証またはアラートを実行して、コントロールを次のステートメントに移動することはできますか?
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
           {.........}
}
私が苦労している部分はここにあります:
グリッドビューに行がない場合は、okキャンセルポップアップを提供しようとしています。
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?');",       
    }