using System;
using System.Web.UI;

public partial class SelectionList : Page
{
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
       lblSelection.Text =
          String.Format("<p>Zaznaczony indeks: {0}<br />Zaznaczony tekst: {1}<br />Zaznaczona wartość: {2}</p>",
            DropDownList1.SelectedIndex.ToString(), DropDownList1.SelectedItem.Text, DropDownList1.SelectedValue);
    }
}
