Код | If Session("Basket") Is Nothing Then Session("Basket") = New List(Of Product) End If
CType(Session("Basket"), List(Of Product)).Add(Me.product) Page.Response.Redirect("Bascet.aspx")
|
Response.Redirect не переводит на нужную страницу, если поменять класс(Product) для Session("Basket") = New List(Of Product) на какой нибудь, все работает. Вот часть кода класса Product:
Код | Imports System.Collections.Generic
Namespace AdvantShop.Data
Public Class Product
Private _Id As String Private _Name As String Private _Photo As String Private _Ratio As Double Private _Discount As Double Private _ShippingPrice As Decimal Private _Weight As Double Private _Size As String Private _IsFreeShipping As Boolean Private _ItemsSold As Integer Private _BriefDescription As String Private _Description As String Private _Enabled As Boolean Private _ShowRatio As Boolean Private _EnabledRatio As Boolean Private _Offers As List(Of Offer) Private _Recomended As Boolean Private _New As Boolean Private _Bestseller As Boolean Private _OnSale As Boolean
Private _ArtNo As String Public Property ArtNo() As String Get Return _ArtNo End Get Set(ByVal value As String) _ArtNo = value End Set End Property
Private _PageMeta As MetaInfo Public Property PageMeta() As MetaInfo Get Return _PageMeta End Get Set(ByVal value As MetaInfo) _PageMeta = value End Set End Property
Private _isFirstPageProduct As Boolean Public Property IsFirstPageProduct() As Boolean Get Return _isFirstPageProduct End Get Set(ByVal value As Boolean) _isFirstPageProduct = value End Set End Property
Public Property Id() As String Get Return _Id End Get Set(ByVal value As String) _Id = 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 Photo() As String Get Return _Photo End Get Set(ByVal value As String) _Photo = value End Set End Property
Public Property Ratio() As Double Get Return _Ratio End Get Set(ByVal value As Double) _Ratio = value End Set End Property Public Property Discount() As Double Get Return _Discount End Get Set(ByVal value As Double) _Discount = value End Set End Property Public Property ShippingPrice() As Decimal Get Return _ShippingPrice End Get Set(ByVal value As Decimal) _ShippingPrice = value End Set End Property Public Property Weight() As Double Get Return _Weight End Get Set(ByVal value As Double) _Weight = value End Set End Property Public Property Size() As String Get Return _Size End Get Set(ByVal value As String) _Size = value End Set End Property Public Property IsFreeShipping() As Boolean Get Return _IsFreeShipping End Get Set(ByVal value As Boolean) _IsFreeShipping = value End Set End Property Public Property ItemsSold() As Integer Get Return _ItemsSold End Get Set(ByVal value As Integer) _ItemsSold = value End Set End Property Public Property BriefDescription() As String Get Return _BriefDescription End Get Set(ByVal value As String) _BriefDescription = value End Set End Property Public Property Description() As String Get Return _Description End Get Set(ByVal value As String) _Description = value End Set End Property Public Property Enabled() As Boolean Get Return _Enabled End Get Set(ByVal value As Boolean) _Enabled = value End Set End Property Public Property ShowRating() As Boolean Get Return _ShowRatio End Get Set(ByVal value As Boolean) _ShowRatio = value End Set End Property Public Property EnabledRating() As Boolean Get Return _EnabledRatio End Get Set(ByVal value As Boolean) _EnabledRatio = value End Set End Property Public Property Offers() As List(Of Offer) Get Return _Offers End Get Set(ByVal value As List(Of Offer)) _Offers = value End Set End Property Public Property Recomended() As Boolean Get Return _Recomended End Get Set(ByVal value As Boolean) _Recomended = value End Set End Property Public Property NewProduct() As Boolean Get Return _New End Get Set(ByVal value As Boolean) _New = value End Set End Property Public Property BestSeller() As Boolean Get Return _Bestseller End Get Set(ByVal value As Boolean) _Bestseller = value End Set End Property Public Property OnSale() As Boolean Get Return _OnSale End Get Set(ByVal value As Boolean) _OnSale = value End Set End Property
End Class
End Namespace
|
|