0

尝试获取 DropDownList 的选定值时,我遇到了一个非常奇怪的问题。我的页面上有以下控件:4 个下拉列表、2 个文本框、6 个列表框和一个按钮。目前单击按钮,所有控件都保留其数据,我可以从后面的代码中访问它们。但是有一个控件的行为方式不同。它是 4 个 DropDownlist 之一。当尝试执行以下操作时,它只会得到一个空字符串:

string sData1 = this.DropDownList1.SelectedValue;  --> works OK
string sData2 = this.DropDownList2.SelectedValue;  --> works OK
string sData3 = this.DropDownList3.SelectedValue;  --> works OK
string sData4 = this.DropDownList4.SelectedValue;  --> is NOT working

基本上这是我对每个 DropDownList 的 HTML 标记:

<asp:DropDownList ID="DropDownLis1" runat="server"></asp:DropDownList>
<asp:DropDownList ID="DropDownLis2" runat="server"></asp:DropDownList>
<asp:DropDownList ID="DropDownLis3" runat="server"></asp:DropDownList>
<asp:DropDownList ID="DropDownLis4" runat="server"></asp:DropDownList>

我在互联网上搜索,看看是否有相关的东西,但没有运气。我的另一个疑问如下。是否存在视图状态已满且不存储该 DropDownList 的选定值的可能性?

任何线索或帮助将不胜感激谢谢

4

0 回答 0