private void SetCategories() { var listClass = new ListClass(); var list = listClass.GetList(); ddl_categories.DataSource = list; ddl_categories.DataTextField = "Title"; ddl_categories.DataValueField = "Id"; ddl_categories.DataBind(); //ddl_categories.Items.Insert(0, new ListItem("- Select -", "-1")); }
protected void Page_Load(object sender, EventArgs e) { var listClass = new ListClass(); var list = listClass.GetList(); lit_menu.Text = "<ul data-role=\"listview\" data-filter=\"true\" data-filter-placeholder=\"Search\">"; lit_menu.Text += "<li data-role=\"list-divider\">Categories</li>"; lit_menu.Text += "<li><a href=\"Default.aspx\">All</a></li>"; foreach (var item in list) { lit_menu.Text += string.Format("<li><a href=\"List.aspx?id={0}\">{1}</a></li>", item.Id, item.Title); } lit_menu.Text += "</ul>"; }