i use below code for create arraylist()
But i got this error :
Type 'ItemInf' in Assembly 'App_Code.pnpn3 1qh, Version=0.0.0.0 , Culture=neutral , PublicKeyToken= null' is not marked as serializable
any sugestion ??
Code:
Dim ItemsT As New ArrayList()
If ViewState("items") IsNot Nothing Then
ItemsT = DirectCast(ViewState("items"), ArrayList)
Else
ItemsT = New ArrayList()
End If
Dim itemID As Integer = EasyListBoxItemT.SelectedValue
Dim count As String = TextBoxCount.Text
Dim Dv As Data.DataView
Dv = ListData.vag_list_GetItem(itemID).Tables(0).DefaultView
Dim name As String = Dv.Item(0).Item("name")
Dim Code As String = Dv.Item(0).Item("Code")
Dim additem As ItemInf = New ItemInf()
additem.ID = itemID
additem.Code = Code
additem.count = count
additem.Name = name
ItemsT.Add(additem)
ViewState("items") = ItemsT
TextBoxCount.Text = ""
EasyListBoxItemT.ClearSelection()
Public Class ItemInf
Public itemID As Integer
Public _Name As String
Public _Code As String
Public _count As String
'Public Sub New(ByVal itemid As Integer, ByVal name As String, ByVal code As String, ByVal count As String)
' Me.itemID = itemid
' Me._Code = code
' Me._count = count
' Me._Name = name
'End Sub
Public Property ID() As Integer
Get
Return itemID
End Get
Set(ByVal value As Integer)
itemID = value
End Set
End Property
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Public Property Code() As String
Get
Return _Code
End Get
Set(ByVal value As String)
_Code = value
End Set
End Property
Public Property count() As String
Get
Return _count
End Get
Set(ByVal value As String)
_count = value
End Set
End Property
End Class
Type 'ItemInf' in Assembly 'App_Code.pnpn3 1qh, Version=0.0.0.0 , Culture=neutral , PublicKeyToken= null' is not marked as serializable
any sugestion ??
Comment