protected void Button_tj_Click(object sender, EventArgs e)
{
.....
if (ds.Tables[0].Rows.Count == 0)
{
//在此处询问用户是否继续下去,然后决定程序是否走下去
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
int nColumnCount = GridView1.Rows[0].Cells.Count;
GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = nColumnCount;
GridView1.Rows[0].Cells[0].Text = "无记录";
GridView1.RowStyle.Height = 30; GridView1.RowStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
}
.....
}
{
.....
if (ds.Tables[0].Rows.Count == 0)
{
//在此处询问用户是否继续下去,然后决定程序是否走下去
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
int nColumnCount = GridView1.Rows[0].Cells.Count;
GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = nColumnCount;
GridView1.Rows[0].Cells[0].Text = "无记录";
GridView1.RowStyle.Height = 30; GridView1.RowStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
}
.....
}
if(Hf.Value.Equals("1"))
{ }
//下一步按钮点击后触发的程序
protected v oid NextStepBtn_Click(object sender, EventArgs e)
{
//在此处询问用户是否继续下去,然后决定程序是否走下去
ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
int nColumnCount = GridView1.Rows[0].Cells.Count;
GridView1.Rows[0].Cells.Clear();
GridView1.Rows[0].Cells.Add(new TableCell());
GridView1.Rows[0].Cells[0].ColumnSpan = nColumnCount;
GridView1.Rows[0].Cells[0].Text = "无记录";
GridView1.RowStyle.Height = 30; GridView1.RowStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center;
}protected void Button_tj_Click(object sender, EventArgs e)
{ if (ds.Tables[0].Rows.Count == 0)
{
nextStepBtn.Visible = true; //显示是否“下一步”按钮,等待用户点击,nextStepBtn.Visible默认设置为false
} }
{
ClientScript.RegisterStartupScript(this.GetType(), "message", " <script language='javascript' >if(Confirm('确认码?'))document.getElementById('Hf').value='1'; else document.getElementById('Hf').value='0'; </script>");
if (Hf.Value.Equals("1"))
{
lastMonthData.Insert(intYear, intMonth, checkedDeptNum, UserID, out strMsg);
ds = null;
ds_count = null;
ds = dbSys.ExecuteDataSet(strSql, AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize);
ds_count = dbSys.ExecuteDataSet(strSql);
AspNetPager1.RecordCount = ds_count.Tables[0].Rows.Count;
}
else
{
return;
} }
程序并没有提示出来,为什么?
如果根据情况提示不同,那就需要你自己拼凑好js字符串,然后再弹出了