Results 1 to 2 of 2

Thread: date validations

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Location
    Orlando
    Posts
    30

    date validations

    i would like to validate that my

    txtCloseDate is greater than my txt.StartDate

    can some one help please.

    her is my code

    <CODE>

    Private Sub img_cal1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_cal1.Click

    Session("Cal1") = True
    Session("Cal2") = False

    If Me.Calendar1.Visible = True Then
    Me.Calendar1.Visible = False
    Else
    Me.Calendar1.Visible = True
    End If


    End Sub

    Private Sub img_cal2_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles img_cal2.Click
    Session("Cal2") = True
    Session("Cal1") = False
    Me.Calendar1.Visible = True
    End Sub

    Private Sub Calendar1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
    If Session("Cal1") = True Then
    txt_OpenDate.Text = Calendar1.SelectedDate.ToShortDateString
    Session("Cal1") = False
    ElseIf Session("Cal2") = True Then
    txt_CloseDate.Text = Calendar1.SelectedDate.ToShortDateString
    Session("Cal2") = False
    End If
    Me.Calendar1.Visible = False

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Me.Calendar1.Visible = True
    End Sub

    Private Sub txt_CloseDate_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_CloseDate.TextChanged

    End Sub

    </CODE>

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    if(DateTime.Parse(txtCloseDate.Text) > DateTime.Parse(txtStartDate.Text))
    {
    // ...do whatever...
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width