Use of ListBox multi-choice mode (selectionmode = multiple)
Set the attribute of ListBox to: selectionmode = multiple
Multiple ListBox functions can be implemented.
To obtain these selected listitems, it is easy to use winform!
This. lst_axzhz.selecteditems;
However, it is troublesome in ASP. NET! (It can also be implemented through scripts. This is troublesome. You can leave it alone without making PostBack .)
Listitemcollection items = new listitemcollection ();
Foreach (listitem item in this. lst_axzhz.items)
{
Function onclick ()
{
Function onclick ()
{
This. style. Display = 'none'; codehighlighter=137_259_open_text.style.display = 'none'; codehighlighter=137_259_closed_image.style.display = 'inline'; inline = 'inline ';
}
}
} "Src =" http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif "alt =" "align =" TOP "> {
Function onclick ()
{
Function onclick ()
{
This. style. Display = 'none'; items = 'none'; codehighlighter=137_259_open_image.style.display = 'inline'; codehighlighter=137_259_open_text.style.display = 'inline ';
}
}
} "Src =" http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif "alt =" "align =" TOP "> {
If (item. Selected)
{
Function onclick ()
{
Function onclick ()
{
This. style. Display = 'none'; codehighlighter1_1__245_open_text.style.display = 'none'; codehighlighter1_1__245_closed_image.style.display = 'inline'; inline = 'inline ';
}
}
} "Src =" http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif "alt =" "align =" TOP "> {
Function onclick ()
{
Function onclick ()
{
This. style. Display = 'none'; items = 'none'; codehighlighter1_1__245_open_image.style.display = 'inline'; codehighlighter1_1__245_open_text.style.display = 'inline ';
}
}
} "Src =" http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif "alt =" "align =" TOP "> {
Items. Add (item );
}
}