Hashtable: string key and string value (C#) : Hashtable « Collections « ASP.Net






Hashtable: string key and string value (C#)

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


void Page_Load(){
    Hashtable myHashtable = new Hashtable();

    myHashtable["UK"] = "United Kingdom";


    string CountryName;
    CountryName = Convert.ToString(myHashtable["UK"]);   
    lblOut.Text = CountryName;

} 


</script>
<html>
    <head>
    </head>
    <body>
        <form runat="server">
        <asp:Label runat="server" ID = "lblOut">Label</asp:Label>
        </form>
    </body>
</html>

           
       








Related examples in the same category

1.For Each loop through a Hashtable (VB.net)
2.Define and use Hashtable (VB.net)
3.For each statement for Hashtable (C#)
4.Hashtable: int key and string value (C#)
5.Hash table: Date key and string value (C#)
6.Hash table Key is case sensitive (C#)