Net Tutorial: ASP. NET SortedList object
SortedList object features a combination of ArrayList objects and hash table objects.
In the SortedList object
The SortedList object contains the key/value pairs of the project. A SortedList Automatically sorts the project letters or numbers in an object.
The project is added to SortedList and the purchase () method. The size of a SortedList can be used as the final size and TrimToSize () method.
The following code creates a SortedList named mycountries and four elements:
<Script runat = "server">
Sub Page_Load
If Not Page. IsPostBack then
Dim mycountries = New SortedList
Mycountries. Add ("N", "Norway ")
Mycountries. Add ("S", "Sweden ")
Mycountries. Add ("F", "France ")
Mycountries. Add ("I", "Italy ")
End if
End sub
</Script>
Controls the text and values automatically generated by the data-bound adsortedlist object: dynamic: RadioButtonList dynamic: CheckBoxList dynamic: pull-down list dynamic: The list box binds data to the RadioButtonList control, first, create a RadioButtonList control (without any ASP: ListItem element. Aspx page: html>
<Body> <form runat = "server">
<Asp: RadioButtonList id = "rb" runat = "server"
AutoPostBack = "True"/> </form> </body>
<Ml> then add a script to create a list: <script runat = "server">
Sub Page_Load
If Not Page. IsPostBack then
Dim mycountries = New SortedList
Mycountries. Add ("N", "Norway ")
Mycountries. Add ("S", "Sweden ")
Mycountries. Add ("F", "France ")
Mycountries. Add ("I", "Italy ")
Rb. DataSource = mycountries rb. DataValueField = "Key" rb. DataTextField = "Value" rb. DataBind ()
End if
End sub
</Script> <Body> <form runat = "server">
<Asp: RadioButtonList id = "rb" runat = "server"
AutoPostBack = "True"/> </form> </body>
<Ml>