没有出现楼主的情况,我的测试代码<script language="VB" runat="server">
public sub page_load(byval sender as Object,byval e as EventArgs)
if not page.isPostBack then
listbox1.items.add("aaa")
listbox1.items.add("bbb")
listbox1.items.add("ccc")
end if
end subpublic sub myclick(byval sender as Object,byval e as EventArgs)
sender.text="clicked !"
end sub
</script><form id="form1" runat="server">
<asp:ListBox runat="server" SelectionMode="Multiple" id="listbox1"/>
<asp:Button runat="server" Text="click me" onclick="myclick"/>
</form>
public sub page_load(byval sender as Object,byval e as EventArgs)
if not page.isPostBack then
listbox1.items.add("aaa")
listbox1.items.add("bbb")
listbox1.items.add("ccc")
end if
end subpublic sub myclick(byval sender as Object,byval e as EventArgs)
sender.text="clicked !"
end sub
</script><form id="form1" runat="server">
<asp:ListBox runat="server" SelectionMode="Multiple" id="listbox1"/>
<asp:Button runat="server" Text="click me" onclick="myclick"/>
</form>
<form id="Form1" method="post" runat="server">
<asp:listbox id="lst1" Rows="2" SelectionMode="Multiple" Runat="server" Width="272px">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="5">5</asp:ListItem>
</asp:listbox><asp:button id="btnAdd" Runat="server" Text="Add"></asp:button>
</form>