01.
Imports
System
02.
Imports
System.Web.UI.WebControls
03.
04.
Public
partial
Class
Posts_GeneralASPNET_DataPresentationControls_1270874
05.
Inherits
System.Web.UI.Page
06.
Private
ReadOnly
Property
Items()
As
ListItemCollection
07.
Get
08.
If
Me
.Session(
"Items"
)
Is
Nothing
Then
09.
Me
.Session(
"Items"
) =
New
ListItemCollection()
10.
End
If
11.
12.
Return
Me
.Session(
"Items"
) as ListItemCollection
13.
End
Get
14.
End
Property
15.
16.
Private
Sub
GetData()
17.
GridView1.DataSource =
Me
.Items
18.
GridView1.DataBind()
19.
End
Sub
20.
21.
Protected
Sub
ListBox1_SelectedIndexChanged(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
22.
If
Not
Me
.Items.Contains(ListBox1.SelectedItem)
Then
23.
Me
.Items.Add(ListBox1.SelectedItem)
24.
End
If
25.
26.
Me
.GetData()
27.
End
Sub
28.
End
Class
29.
30.
31.
32.
33.