datepicker help needed

T

TJS

found this code but get error message on handles
Compiler Error Message: BC30506: Handles clause requires a WithEvents
variable.

can anyone help resolve this ??


============================================
'Just drag calendar control onto the screen and turn it invisible.
'When you click a button, like "Get Date" or a picture of a calendar, turn
it visible:

Private Sub calTo_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles calTo.Click
Me.Calendar2.Visible = True
Me.Calendar2.BackColor = White
End Sub

'Then when you select a date, store it in a text box, check an option
button,
turn the calendar invisible and store the date in the session object for
'future use such as when you return to the page for a 2nd search.

Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged

Me.txtDateFrom.Text = Me.Calendar1.SelectedDate.ToShortDateString
Me.optFrom.Checked = True
Me.Calendar1.Visible = False
Session("txtDateFrom") = txtDateFrom.Text.ToString

End Sub
============================================
 
O

Oliver

How many calendars do you have on the page?

Your code suggests three:

calTo.Click
Calendar1.SelectionChanged
Me.Calendar2.Visible

Is it just a naming mixup?

Anyway, sometimes VS.NET gets mixed up with the adding and removing of big
controls. You might need to add one again, save all files, rename it to
match the name you want to use and save again.

Let us know?
 
T

TJS

hmmm..

not sure what the 3 references mean as I found this example.
I am just hopiong to find some help in getting the code sample cleaned up so
it can work. :)

Also I am not using VS.net I am using web matrix.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top