How do I declare a variable that will be available to me to every sub on my page?
I tried putting the Dim statement before the first Sub, after the Script command, but when the page returns from the server, it's blank.
I'm using 1 calendar control to update 2 textboxes depending on which button I press.
<%@ Page Language="VB" %>
<script runat="server">
' Insert page code here
'
Private byWhichDate As Byte 'THIS DOES NOT WORK - IT DOES NOT KEEP IT'S NUMBER.
Sub Page_Load(Sender As Object, E As EventArgs)
If Not Page.IsPostBack Then
End If
End Sub
Sub btnShowCallDateCalendar_Click(sender As Object, e As EventArgs)
response.write(byWhichDate)
If calCallDate.Visible = False Then
calCallDate.Visible = True
byWhichDate = 1
Else
calCallDate.Visible = False
byWhichDate = 0
End If
End Sub
Sub btnShowNextCallDateCalendar_Click(sender As Object, e As EventArgs)
response.write(byWhichDate)
If calCallDate.Visible = False Then
calCallDate.Visible = True
byWhichDate = 2
Else
calCallDate.Visible = False
byWhichDate = 0
End If
End Sub
Sub btnAddDetail_Click(sender As Object, e As EventArgs)
End Sub
Sub btnCancel_Click(sender As Object, e As EventArgs)
Response.Redirect("AgwayMaster.aspx"
End Sub
Sub calCallDate_SelectionChanged(sender As Object, e As EventArgs)
response.write(byWhichDate)
Select byWhichDate
Case 1
txtCallDate.Text = calCallDate.SelectedDate
calCallDate.Visible = False
Case 2
txtNextCallDate.Text = calCallDate.SelectedDate
calCallDate.Visible = False
Case Else
End Select
End Sub
</script>
<html>
<head>
</head>
... Here is the 2 textboxes and a calender control.
I tried putting the Dim statement before the first Sub, after the Script command, but when the page returns from the server, it's blank.
I'm using 1 calendar control to update 2 textboxes depending on which button I press.
<%@ Page Language="VB" %>
<script runat="server">
' Insert page code here
'
Private byWhichDate As Byte 'THIS DOES NOT WORK - IT DOES NOT KEEP IT'S NUMBER.
Sub Page_Load(Sender As Object, E As EventArgs)
If Not Page.IsPostBack Then
End If
End Sub
Sub btnShowCallDateCalendar_Click(sender As Object, e As EventArgs)
response.write(byWhichDate)
If calCallDate.Visible = False Then
calCallDate.Visible = True
byWhichDate = 1
Else
calCallDate.Visible = False
byWhichDate = 0
End If
End Sub
Sub btnShowNextCallDateCalendar_Click(sender As Object, e As EventArgs)
response.write(byWhichDate)
If calCallDate.Visible = False Then
calCallDate.Visible = True
byWhichDate = 2
Else
calCallDate.Visible = False
byWhichDate = 0
End If
End Sub
Sub btnAddDetail_Click(sender As Object, e As EventArgs)
End Sub
Sub btnCancel_Click(sender As Object, e As EventArgs)
Response.Redirect("AgwayMaster.aspx"
End Sub
Sub calCallDate_SelectionChanged(sender As Object, e As EventArgs)
response.write(byWhichDate)
Select byWhichDate
Case 1
txtCallDate.Text = calCallDate.SelectedDate
calCallDate.Visible = False
Case 2
txtNextCallDate.Text = calCallDate.SelectedDate
calCallDate.Visible = False
Case Else
End Select
End Sub
</script>
<html>
<head>
</head>
... Here is the 2 textboxes and a calender control.