Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 当点击按钮,然后显示消息_Html_Asp.net_Css - Fatal编程技术网

Html 当点击按钮,然后显示消息

Html 当点击按钮,然后显示消息,html,asp.net,css,Html,Asp.net,Css,我有一个添加管理员帐户表单,当我添加帐户时,我想在我点击按钮时显示消息“已成功创建”,在这里,当我调试我的项目并打开表单时,这个标签已经显示了我如何删除它 这里是css和html <asp:Label ID="Lbe6" class="message success" runat="server"></asp:Label> 代码 如果要在消息成功之前隐藏标签,请将Lbe6.Visible=false,然后在设置消息成功时将其设置回Lbe6.Visible=true

我有一个添加管理员帐户表单,当我添加帐户时,我想在我点击按钮时显示消息“已成功创建”,在这里,当我调试我的项目并打开表单时,这个标签已经显示了我如何删除它

这里是css和html

<asp:Label ID="Lbe6" class="message success"  runat="server"></asp:Label> 
代码


如果要在消息成功之前隐藏标签,请将
Lbe6.Visible=false
,然后在设置消息成功时将其设置回
Lbe6.Visible=true

请尝试以下操作:

protected void Btn_SignUp_Click(object sender, EventArgs e)
{
  try
  {  c1.SignUp(nametxt.Value, passtxt.Value, Convert.ToInt32(DropDownList1.SelectedValue),     
 Convert.ToInt32(DropDownList2.SelectedValue),Convert.ToInt32(DropDownList3.SelectedValue),m      ailtxt.Value,numbtxt.Value);
                //GridView1.DataSource=ca.viewadmin();
                 Lbe6.Text = (" Account Successfully Created");
                //  GridView1.DataBind();
            }
            catch
            {

               lbe5.Text = ("SIGNUP FAILED.PLEASE TRY AGAIN");
               lbe5.Visible = true;

            }
            nametxt.Value = "";
            passtxt.Value = "";

            mailtxt.Value = "";
            numbtxt.Value = "";

}
protected void Page_Load(object sender, EventArgs e)
{
     Lbe6.Visible = false;
     Lbe5.Visible = false;
}
试试这个

protected void Btn_SignUp_Click(object sender, EventArgs e)
        {//If not working properly set the visible attribute on button click also
            try
            {

                c1.SignUp(nametxt.Value, passtxt.Value, Convert.ToInt32(DropDownList1.SelectedValue), Convert.ToInt32(DropDownList2.SelectedValue),Convert.ToInt32(DropDownList3.SelectedValue),mailtxt.Value,numbtxt.Value);
                //GridView1.DataSource=ca.viewadmin();
                 Lbe6.Visible = true;
                 Lbe6.Text = (" Account Successfully Created");
                //  GridView1.DataBind();
            }
            catch
            {
               Lbe5.Visible = true;
               lbe5.Text = ("SIGNUP FAILED.PLEASE TRY AGAIN");

            }
            nametxt.Value = "";
            passtxt.Value = "";

            mailtxt.Value = "";
            numbtxt.Value = "";

        }

 protected void Page_Load(object sender, EventArgs e)
        {
 Lbe6.Visible = false;
Lbe5.Visible = false;
}

客户端消息还是服务器端消息?您想删除什么?我试图删除这个粉红色框中的小对象,并希望在填充所有文本框并单击“提交”按钮时显示此内容,然后在添加此内容时显示此内容确定,然后单击“提交”按钮,然后消息不显示…现在我该做什么?@user3134694打开按钮单击请添加文本并将visible设置为true。它肯定是可见的:)@user3134694你能添加你的按钮点击代码吗?你在代码隐藏中做什么?
protected void Btn_SignUp_Click(object sender, EventArgs e)
{
  try
  {  c1.SignUp(nametxt.Value, passtxt.Value, Convert.ToInt32(DropDownList1.SelectedValue),     
 Convert.ToInt32(DropDownList2.SelectedValue),Convert.ToInt32(DropDownList3.SelectedValue),m      ailtxt.Value,numbtxt.Value);
                //GridView1.DataSource=ca.viewadmin();
                 Lbe6.Text = (" Account Successfully Created");
                //  GridView1.DataBind();
            }
            catch
            {

               lbe5.Text = ("SIGNUP FAILED.PLEASE TRY AGAIN");
               lbe5.Visible = true;

            }
            nametxt.Value = "";
            passtxt.Value = "";

            mailtxt.Value = "";
            numbtxt.Value = "";

}
protected void Page_Load(object sender, EventArgs e)
{
     Lbe6.Visible = false;
     Lbe5.Visible = false;
}
protected void Btn_SignUp_Click(object sender, EventArgs e)
        {//If not working properly set the visible attribute on button click also
            try
            {

                c1.SignUp(nametxt.Value, passtxt.Value, Convert.ToInt32(DropDownList1.SelectedValue), Convert.ToInt32(DropDownList2.SelectedValue),Convert.ToInt32(DropDownList3.SelectedValue),mailtxt.Value,numbtxt.Value);
                //GridView1.DataSource=ca.viewadmin();
                 Lbe6.Visible = true;
                 Lbe6.Text = (" Account Successfully Created");
                //  GridView1.DataBind();
            }
            catch
            {
               Lbe5.Visible = true;
               lbe5.Text = ("SIGNUP FAILED.PLEASE TRY AGAIN");

            }
            nametxt.Value = "";
            passtxt.Value = "";

            mailtxt.Value = "";
            numbtxt.Value = "";

        }

 protected void Page_Load(object sender, EventArgs e)
        {
 Lbe6.Visible = false;
Lbe5.Visible = false;
}