【发布时间】:2010-04-30 23:52:13
【问题描述】:
我在从中选择一些项目后处理列表框时遇到问题。在我的标记中,列表框包含在 asp:panel 中,并在代码隐藏中的页面加载期间填充。这部分工作正常。
当我选择各种项目并提交时,我遇到了麻烦。我的处理程序遍历列表框项目,但没有看到任何被选中。我不知道为什么。
这是标记:
<asp:Panel ID="panEdit" runat="server" Height="180px" Width="400px" CssClass="ModalWindow">
<table width="100%">
<asp:label runat = "server">Choose your items</asp:label>
<tr>
<td>
<asp:ListBox ID="lstFundList" runat="server" SelectionMode="Multiple" OnLoad="lstFundList_LoadData">
</asp:ListBox>
</td>
</tr>
</table>
<asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_OnClick"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClientClick="$find('ModalPopupExtender1').hide(); return false;" />
</asp:Panel>
在我的btnUpdate_OnClick 处理程序中,我看不到任何标记为选中的列表框项目。我认为回发和面板发生了一些奇怪的事情?
【问题讨论】: