<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";後臺