A
Amar
After using Server.Transfer to transfer data from one page
to another, I would like to know if there is a way to keep
the receiving web page variables intact after a postback.
Here is the code from the "sending" page:
<code>
Public ReadOnly Property SelectedDate() As Date
Get
Return Calendar1.SelectedDate
End Get
End Property
..
..
..
Server.Transfer("SignUp.aspx")
</code>
Here is the code in the receiving page:
<code>
Protected SelectedDate As Date
Public clsCalendar As Calendar
..
..
..
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
clsCalendar = CType(Context.Handler, Calendar)
SelectedDate = clsCalendar.SelectedDate
Session.Item("dteSelectedDAte") = CType(SelectedDate, Date)
End Sub
</code>
I am forced to place the property SelectedDate into a
Session variable (Session.Item("dteSelectedDAte") = CType
(SelectedDate, Date)
) because after the postback, I lose access to the
receivning varaible (SelectedDate) which was transferred
from the original page. Now, however, after a postback,
the sending page is the same page, not the original.
Thanks in advance,
Amar
to another, I would like to know if there is a way to keep
the receiving web page variables intact after a postback.
Here is the code from the "sending" page:
<code>
Public ReadOnly Property SelectedDate() As Date
Get
Return Calendar1.SelectedDate
End Get
End Property
..
..
..
Server.Transfer("SignUp.aspx")
</code>
Here is the code in the receiving page:
<code>
Protected SelectedDate As Date
Public clsCalendar As Calendar
..
..
..
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
clsCalendar = CType(Context.Handler, Calendar)
SelectedDate = clsCalendar.SelectedDate
Session.Item("dteSelectedDAte") = CType(SelectedDate, Date)
End Sub
</code>
I am forced to place the property SelectedDate into a
Session variable (Session.Item("dteSelectedDAte") = CType
(SelectedDate, Date)
) because after the postback, I lose access to the
receivning varaible (SelectedDate) which was transferred
from the original page. Now, however, after a postback,
the sending page is the same page, not the original.
Thanks in advance,
Amar