lauren brown

lauren brown

  • NA
  • 33
  • 93.4k

Hide buttons from pop-up panel

Feb 13 2011 9:45 PM
Hi experts, I have this page that will pop up search box for user to add in colleague and  I am using a asp:panel to do this. There are 4 buttons in the panel and I need to hide 2 of them in the search box panel. How do I do that? 

This are the codes for the 2 buttons that I would like to hide.
 //confirm selection to be included in stafflist
        protected void ConfirmBtn_Click(object sender, EventArgs e)
        {       
                int sel = 0;
                for (int i = 0; i < SearchLB.Items.Count; i++)
                {
                    if (SearchLB.Items[i].Selected == true)
                    {
                        sel++;
                        if (!ListBox1.Items.Contains(SearchLB.Items[i]))
                        {
                            SQL dbAdapter = new SQL();
                            dbAdapter.insertStafflist(SearchLB.Items[i].Text, (string)Session["userName"]);
                        }

                    }
                }
                if (sel == 0)
                {
                    MessageBox.Show("There is no selected staff to be added.", "Error!");
                }
                
                SearchTB.Text = string.Empty;
                SearchLB.Visible = false;
                //generate listbox items
                populateStafflist();        
        }

        //close popup
        protected void CancelBtn_Click(object sender, EventArgs e)
        {
            SearchTB.Text = string.Empty;
            SearchLB.Visible = false;
        }

Thank you in advanced! 

Answers (1)