Sorted List Demo (C#) : SortedList « Collections « ASP.Net






Sorted List Demo (C#)

<%@ Page Language="C#" %>
<script runat="server">

       void Page_Load()
       {
            SortedList stlShippers = new SortedList();
        
            stlShippers["cp"]="CP";
            stlShippers["fe"]="FE";
            stlShippers["us"]="US";
        
            lblOut.Text = "Your selection = " + stlShippers[txtCodeIn.Text];
       }

</script>
<html>
    <head>
    </head>
    <body>
        <form runat="server">
        Please enter a shipper code ("cp" "fe" "us"): 
        <asp:TextBox runat="server" ID="txtCodeIn"></asp:TextBox><br>
        <asp:Button runat="server" Text="Button"></asp:Button><br>
        <asp:Label runat="server" ID = "lblOut">Label</asp:Label>
        </form>
    </body>
</html>
           
       








Related examples in the same category

1.SortedList Demo (VB.net)
2.Use SortedList (C#)