NaiSuyeahyeah
NaiSuyeahyeah
2015-11-19 13:16

detailsview insert 检查出未输入textbox时 如何弹出提示讯息加遮罩层?

  • textbox
  • iteminserting
  • 遮罩
  • detailsview
  • gridview

两个东西, detailsview里输入资料, 存进gridview里, 资料来源是用access资料表 ,
其中gridview有加上updatepanel , detailsview已经转成样板..
長這樣

目前后端代码是这样

 protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        TextBox tb1 = (TextBox)DetailsView1.FindControl("TextBox1");
        TextBox tb2 = (TextBox)DetailsView1.FindControl("TextBox2");
        TextBox tb3 = (TextBox)DetailsView1.FindControl("TextBox3");
        TextBox tb4 = (TextBox)DetailsView1.FindControl("TextBox4");
        TextBox tb5 = (TextBox)DetailsView1.FindControl("TextBox5");
        TextBox tb6 = (TextBox)DetailsView1.FindControl("TextBox6");
        if (tb1.Text == "")
        {
            e.Cancel = true;
            return;
        }
        if (tb2.Text == "")
        {
            e.Cancel = true;
            return;
        }
        if (tb3.Text == "")
        {
            e.Cancel = true;
            return;
        }
        if (tb4.Text == "")
        {
            e.Cancel = true;
            return;
        }
        if (tb5.Text == "")
        {
            e.Cancel = true;
            return;
        }
        if (tb6.Text == "")
        {
            e.Cancel = true;
            return;
        }
    }

请问当textbox有未输入时,跳出提示讯息加遮罩怎么写?? 谢谢!!
像这样
像這樣

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答