This is weird in ASP.NET. Whenever you programmatically add items to a collection control (listbox, combobox), you must re-populate the control with each postback.
This is because ViewState only knows the elements added during the page rendering cycle. Adding items on the client side only works for the first time, after which the item is gone.
Try the following:
public partial class Main : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["MyList"] = new List<string>(); } ComboBox cbo = myComboBox;
source share