Hashtable

The Hashtable contains items in key/value pairs.
The keys are used as indexes,and very quick searches can be made for values by searching through their keys.


Following is the sample code for create Hashtable


Sub Page_Load
if Not Page.IsPostBack then
dim MyLanguage=New Hashtable
MyLanguage.Add("T","Tamil")
MyLanguage.Add("E","English")
MyLanguage.Add("M","Malayalam")
MyLanguage.Add("K","Kannada")

rbList.DataSource=mycountries
rbList.DataValueField="Key"
rbList.DataTextField="Value"
rbList.DataBind()
end if
end sub



Create one RadioButtonList control and give the following values.
AutoPostBack="True"
onSelectedIndexChanged="displayMessage"



sub displayMessage(s as Object,e As EventArgs)
lblone.text="Your favorite Language is: " & rbList.SelectedItem.Text
end sub


Comments

Author: Kolan13 Jan 2010 Member Level: Gold   Points : 0

http://www.w3schools.com/aspnet/aspnet_hashtable.asp



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: