J
Jim Bayers
This works and preserves tourID even after a postback:
dim tourID as integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
tourID = Me.Context.Items.Item("id")
Me.ViewState.Add("id", tourID)
Else
tourID = Me.ViewState.Item("id")
End If
End Sub
Why doesn't this work? It seems like it ought to but when you post
back, you lose the variable tourID.
dim tourID as integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
tourID = Me.Context.Items.Item("id")
End If
End Sub
Is there a better way to pass variables between forms?
dim tourID as integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
tourID = Me.Context.Items.Item("id")
Me.ViewState.Add("id", tourID)
Else
tourID = Me.ViewState.Item("id")
End If
End Sub
Why doesn't this work? It seems like it ought to but when you post
back, you lose the variable tourID.
dim tourID as integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then
tourID = Me.Context.Items.Item("id")
End If
End Sub
Is there a better way to pass variables between forms?