<asp:ListBox runat="server" ID="myListBox" OnSelectedIndexChanged="myListBox_SelectedIndexChanged" Height="102px" Width="102px" > <asp:ListItem Text="ListBox1" Value="MyListBoxa"></asp:ListItem> <asp:ListItem Text="ListBox2" Value="MyListBoxad"></asp:ListItem> <asp:ListItem Text="ListBox3" Value="MyListBoxf"></asp:ListItem> <asp:ListItem Text="ListBox4" Value="MyListBoxc"></asp:ListItem> </asp:ListBox<asp:Label ID="Label1" runat="server" Text="Label"/>
protected void myListBox_SelectedIndexChanged(object sender, EventArgs e) { //Response.Write(this.myListBox.SelectedItem.ToString()); this.Label1.Text = "hello world"; }
set AutoPostBack="true"
</asp:ListBox<asp:Label ID="Label1" runat="server" Text="Label"/>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)