<%@ Page Language="C#"%>

<script runat="server">
    protected void BulletedList1_Click(object sender,
       System.Web.UI.WebControls.BulletedListEventArgs e)
    {    
         Label1.Text = "Indeks wybranego elementu: " + e.Index +
            "<br>Wartość wybranego elementu: " + 
            BulletedList1.Items[e.Index].Text;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Kontrolka serwerowa BulletedList</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:BulletedList ID="BulletedList1" runat="server" 
         OnClick="BulletedList1_Click" DisplayMode="LinkButton">
            <asp:ListItem>Stany Zjednoczone</asp:ListItem>
            <asp:ListItem>Wielka Brytania</asp:ListItem>
            <asp:ListItem>Finlandia</asp:ListItem>
            <asp:ListItem>Rosja</asp:ListItem>
            <asp:ListItem>Szwecja</asp:ListItem>
            <asp:ListItem>Estonia</asp:ListItem>
        </asp:BulletedList>
        <asp:Label ID="Label1" runat="server">
        </asp:Label>
    </form>
</body>
</html>
