Avatar of Mike Eghtebas
Mike Eghtebas
Flag for United States of America

asked on 

Create listbox at runtime c#

In the event LoadListBoxes(...);, I need code to create a few list boxes. The name of the listboxes are store in listBoxes object

Question: How can I complete the signature for this event and code it to create only those with Key = True?

   protected void Page_Load(object sender, EventArgs e)
    {
        Dictionary<string, bool> listBoxes =   new Dictionary<string, bool>();
        listBoxes.Add("First_Name",true);
        listBoxes.Add("LastName", false);
        listBoxes.Add("City", true);
        if (!IsPostBack==false)
        {
        }
        else
        {
            LoadListBoxes(Dictionary<string, bool> listBoxes);
        }
    }
    private void LoadListBoxes(Dictionary<string, bool> listBoxes)
{
}
    {

Open in new window

C#.NET ProgrammingVisual Basic.NET

Avatar of undefined
Last Comment
Mike Eghtebas

8/22/2022 - Mon