<asp:DropDownList ID="DropDownListKind" runat="server"> </asp:DropDownList> <br /> <br /> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
后台代码:学习
要认真的看上面的代码呦,能找到问题的所在吗。spa
哈哈!3d
答案如今揭晓:code
都是DropDownListKind.DataValueField = "Kind"; 惹的祸server
因此DropDownList绑定后的Value值都相同,因此不出错才怪呢。blog
所以 DropDownListKind.DataValueField = "Kind";class
改为 DropDownListKind.DataValueField = "Name";后台