s tim stracenim jsi mel pravdu, hodnoty se pri nacteni vzdy inicializovali
upraveny kod vypada takhle:
Imports System.Net.Mail
Partial Class Kalkulace
Inherits System.Web.UI.Page
Public Property PO() As POA
Get
Dim text As POA = ViewState("PO")
If text IsNot Nothing Then
Return text
Else
Dim Ntext As New POA
Return Ntext
End If
End Get
Set(ByVal value As POA)
ViewState("PO") = value
End Set
End Property
Public Property Seznam() As List(Of POA)
Get
Dim text As List(Of POA) = ViewState("Seznam")
If text IsNot Nothing Then
Return text
Else
Dim Ntext As New List(Of POA)
Return Ntext
End If
End Get
Set(ByVal value As List(Of POA))
ViewState("Seznam") = value
End Set
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then StepTyp.Visible = True
Response.Write(PO.Mnozstvi & " / " & PO.Prislusenstvi & " / " & PO.Sirka & " / " & PO.Typ & " / " & PO.Vyska)
End Sub
Protected Sub ImageButtonTyp_Click(ByVal sender As ImageButton, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButtonTyp1.Click, ImageButtonTyp2.Click, ImageButtonTyp3.Click, ImageButtonTyp4.Click, ImageButtonTyp5.Click, ImageButtonTyp6.Click, ImageButtonTyp7.Click, ImageButtonTyp8.Click, ImageButtonTyp9.Click, ImageButtonTyp10.Click, ImageButtonTyp11.Click, ImageButtonTyp12.Click, ImageButtonTyp13.Click, ImageButtonTyp14.Click, ImageButtonTyp15.Click
CreateBorderTyp(sender)
PO.Typ = sender.ToolTip.ToString
End Sub
Protected Sub ImageButtonRozmery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonStepRozmery.Click
PO.Vyska = TextBoxHeight.Text
PO.Sirka = TextBoxWidth.Text
PO.Mnozstvi = TextBoxQuantity.Text
End Sub
End Class
data se ale stale neukladaji, nevim proc :(