0

I am trying to create a checked box list to so that users can check multiple items in a list (this is being used as a filter option on a search page).

There are html helper methods for list box for, drop down list for, multi select form, etc. How do I go about creating a check box list in C#?

0

1 Answer 1

0
var oListBox = new ListBox() { ID = "ID", TabIndex = 10 };
oListBox.Items.Add(new ListItem() { Text = "your text", Value = "your value" });
oListBox.Items.Add(new ListItem() { Text = "your text", Value = "your value" });

.... other items if you want ....

Page.Controls.Add(oListBox);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.