Public Class ShoppingCartItem
        Private _id As Integer
        Private _Title As String
        Private _price As Decimal
        Private _Quantity As Integer        Public Property ID() As Integer
            Get
                Return _id
            End Get
            Private Set(ByVal value As Integer)
                _id = value
            End Set
        End Property
......................
 End Class
    Public Class ShoppingCart
        Private _items As List(Of ShoppingCartItem)()        Public ReadOnly Property Item() As List(Of ShoppingCartItem)
            Get
                Return _items
            End Get
        End Property
End Class
为什么提示“类型“System.Collections.Generic.List(Of AspNetUnleashed.ShoppingCartItem) 的 1 维数组”的值无法转换为“System.Collections.Generic.List(Of AspNetUnleashed.ShoppingCartItem)”。请解答。

解决方案 »

  1.   

    就是那个“ Return _items”中的_items出问题,知道请回阿 !!!
      

  2.   

    vb.net不是很熟Item() 去掉()?
      

  3.   

    Public Class ShoppingCart
            Private _items As List(Of ShoppingCartItem)()        Public ReadOnly Property Item() As List(Of ShoppingCartItem)()
                Get
                    Return _items
                End Get
            End Property
    End Class
      

  4.   

    Dim NewItem As New ShoppingCartItem(intProductID, strProductName, decUnitPrice, intQuantity)
            Profile.ShoppingCart.Item.add(NewItem)
    --------------------------------
    “add”不是“System.Array”的成员。 那这又是什么回事啊,我写了<%@ Import Namespace="AspNetUnleashed" %>了阿。