D
dean.h.brown
How do you get the Calendar date when the page first loads?
I have this code (which works once the user selects a date) - I get
"12:00:00 AM" for the label.text when the page first loads:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Label1.Text = Calendar1.SelectedDate
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Calendar1.SelectionChanged
Label1.Text = Calendar1.SelectedDate
End Sub
I actually have a ton of code that runs when the user changes the date
(pulling info from a database), but I'd like this code to run on the
first time the page loads.
I'd like to call the Calendar1_SelectionChanged sub in the page load
sub using:
"Call Calendar1_SelectionChanged(Calendar1,e)"
but I don't know how to pass the current date (unless I'm doing it
wrong!)
Thanks
I have this code (which works once the user selects a date) - I get
"12:00:00 AM" for the label.text when the page first loads:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Label1.Text = Calendar1.SelectedDate
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Calendar1.SelectionChanged
Label1.Text = Calendar1.SelectedDate
End Sub
I actually have a ton of code that runs when the user changes the date
(pulling info from a database), but I'd like this code to run on the
first time the page loads.
I'd like to call the Calendar1_SelectionChanged sub in the page load
sub using:
"Call Calendar1_SelectionChanged(Calendar1,e)"
but I don't know how to pass the current date (unless I'm doing it
wrong!)
Thanks