1. 程式人生 > >關於為啥ASP.Net C# 中ListBox選中事件一直不生效的問題

關於為啥ASP.Net C# 中ListBox選中事件一直不生效的問題

sel nat csharp page topo edi auto sharp 關於

在pageLoad方法中進行綁定了listbox的值,一定要寫在

if (!IsPostBack)
{
}

這個裏面

並且!!!!一定要設置

<asp:ListBox ID="ListBox1" runat="server" Height="65px" Width="147px" onselectedindexchanged="ListBox1_SelectedIndexChanged" AutoPostBack="True">

關於為啥ASP.Net C# 中ListBox選中事件一直不生效的問題