<%@ Page Language="VB" %>

<script runat="server">
    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, _
       ByVal e As System.EventArgs)
         Response.Write("Wybrałeś element numer " & _
           DropDownList1.SelectedValue & "<br>")
         Response.Write("Nie wybrałeś elementu numer " & _
           DropDownList1.Items(1).Value)
    End Sub
</script>

<html>
<head id="Head1" runat="server">
    <title>Kontrolka serwerowa DropDownList</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:DropDownList ID="DropDownList1" Runat="server" AutoPostBack="True" 
         OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem Value="1">Opcja pierwsza</asp:ListItem>
            <asp:ListItem Value="2" Enabled="False">Opcja druga</asp:ListItem>
            <asp:ListItem Value="3">Opcja trzecia</asp:ListItem>
        </asp:DropDownList>
    </form>
</body>
</html>

