how to get multiselected from listbox in asp.net

by Ali Raza Zaidi on February 1, 2007

we Select multiple indices from list boxes . the listbox have propery of GetSelectedIndicdces . Which return all selected indexes .

so code is like 

int[] _SelectedIndexes = lstBlog.GetSelectedIndices();

foreach (int Y in _SelectedIndexes)

 {            Response.Write(this.lstBlog.Items[Y].Text + ” “ + this.lstBlog.Items[Y].Value );

} where lstBlog is name of listbox

Comments on this entry are closed.

Previous post:

Next post: