By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

variable value being lost

P: n/a
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

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Cor
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.
Nov 20 '05 #2

P: n/a
Cor
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/de...sp11222001.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 date1 = Calendar1.SelectedDate.ToShortDateString()
End Sub

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.