Print - Listbox Control
default.aspx.cs
using System; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ListBox1.Items.Add("Sunday"); ListBox1.Items.Add("Monday"); ListBox1.Items.Add("Tuesday"); ListBox1.Items.Add("Wednesday"); ListBox1.Items.Add("Thursday"); ListBox1.Items.Add("Friday"); ListBox1.Items.Add("Saturday"); } protected void Button1_Click(object sender, EventArgs e) { Label1.Text = "You selected : " + ListBox1.SelectedItem.ToString(); } }
Click the following links to see full source code
C# Source Code
VB.NET Source Code