datepicker help needed

Discussion in 'ASP .Net' started by TJS, Oct 29, 2003.

  1. TJS

    TJS Guest

    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
    ============================================
     
    TJS, Oct 29, 2003
    #1
    1. Advertising

  2. TJS

    Oliver Guest

    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?


    "TJS" <> wrote in message
    news:...
    > 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
    > ============================================
    >
    >
     
    Oliver, Oct 30, 2003
    #2
    1. Advertising

  3. TJS

    TJS Guest

    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.


    "Oliver" <> wrote in message
    news:%...
    > 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?
    >
    >
    > "TJS" <> wrote in message
    > news:...
    > > 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
    > > ============================================
    > >
    > >

    >
    >
     
    TJS, Oct 30, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. WJ
    Replies:
    2
    Views:
    1,585
    Ken Cox [Microsoft MVP]
    Nov 21, 2004
  2. flipdoubt

    DatePicker?

    flipdoubt, Aug 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    576
    John Rivers
    Aug 27, 2005
  3. Luqman
    Replies:
    1
    Views:
    1,137
    =?Utf-8?B?VEg=?=
    Feb 7, 2006
  4. Sunwest Technologies

    [ANN]Web DatePicker for JSP/Servlet 1.0 Released.

    Sunwest Technologies, Jun 7, 2004, in forum: Java
    Replies:
    0
    Views:
    2,098
    Sunwest Technologies
    Jun 7, 2004
  5. Klaus Jensen

    Better datepicker control?

    Klaus Jensen, May 31, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    399
    Klaus Jensen
    Jun 11, 2006
Loading...

Share This Page