variable value being lost

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have 2 calenders on a form and am setting a seperate variable for both calender selections. I need to have the variables have scop
for the entire form, that is what is set in calender1 selection visible in calender 2 selection function. I tried using th
Private test1 as string and private test2 as string
Public Class Vehicle_his
Inherits System.Web.UI.Pag
Private date1 As Strin
Private date2 As Strin
After seting test1 from calender1 selection I put a beakpt in the calender 2 function and test1= nothing when I look at this. Thanks Paul
 
Hi Paul,

How do you set those values and what does that Calender2 function look like?

Cor
I have 2 calenders on a form and am setting a seperate variable for both
calender selections. I need to have the variables have scope
for the entire form, that is what is set in calender1 selection visible in
calender 2 selection function. I tried using the
Private test1 as string and private test2 as string.
Public Class Vehicle_hist
Inherits System.Web.UI.Page
Private date1 As String
Private date2 As String
After seting test1 from calender1 selection I put a beakpt in the
calender 2 function and test1= nothing when I look at this. Thanks Paul.
 
Hi Paul,

Luckily you said that about the webaplication.

You have to save your values or in "session" variables, but things like this
beter in a "viewstate".

Have a look for that.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11222001.asp

If you do not find it, message again.
(But not direct)

I hope this helps?

Cor
Hi here are the functions, I think the problem may have to do with the
value not being saved because it is a web application but do not know for
sure.
Public Class Vehicle_hist
Inherits System.Web.UI.Page
Private date1 As String
Private date2 As String

Private Sub Calendar2_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Calendar2.SelectionChanged
date2 = Calendar2.SelectedDate.ToShortDateString()
End Sub
Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
 
Back
Top