var items = from ListItem li in ListBox1.Items select li; foreach (ListItem li in items) { li.Attributes.Add("disabled", "disabled"); }