01.
<%@ Page Language=
"VB"
%>
02.
<script runat=
"server"
>
03.
Sub
Page_Load(sender
As
Object
, e
As
EventArgs)
04.
Dim
objSortedList
As
SortedList
05.
Dim
i
As
Integer
06.
Dim
lsItem
As
String
07.
08.
objSortedList =
New
SortedList
09.
10.
objSortedList.Add(
"white"
,
"#FFFFFF"
)
11.
objSortedList.Add(
"black"
,
"#000000"
)
12.
objSortedList.Add(
"red"
,
"#FF0000"
)
13.
objSortedList.Add(
"yellow"
,
"#FFFF00"
)
14.
objSortedList.Add(
"green"
,
"#00FF00"
)
15.
16.
IF objSortedList.Contains(
"yellow"
) =
True
Then
17.
Me
.lblText.Text =
"[yellow] is a member"
18.
Else
19.
Me
.lblText.Text =
"[yellow] no a member"
20.
End
IF
21.
22.
End
Sub
23.
</script>
24.
<html>
25.
<head>
26.
<title>ThaiCreate.Com ASP.NET - SortedList</title>
27.
</head>
28.
<body>
29.
<form id=
"form1"
runat=
"server"
>
30.
<asp:Label id=
"lblText"
runat=
"server"
></asp:Label>
31.
<br />
32.
</form>
33.
</body>
34.
</html>