D
David C
I have the following code in my aspx page and I don't think the date
comparison is working and I need help making it work. The line that I think
is a problem is If CDate(tb.Text) < CDate(System.DateTime.Today()) Then
Dim tb As TextBox
Dim btn As Button
Dim row As FormViewRow = fvTickler.Row
If fvTickler.CurrentMode = FormViewMode.ReadOnly Then
tb = row.FindControl("txtExpireDate")
If (Not tb Is Nothing) Then
If tb.Text <> "" Then
If CDate(tb.Text) < CDate(System.DateTime.Today()) Then
'Tickler expired prior to today so make form
background red
fvTickler.RowStyle.BackColor = Drawing.Color.Red
End If
.....
Thanks.
David
comparison is working and I need help making it work. The line that I think
is a problem is If CDate(tb.Text) < CDate(System.DateTime.Today()) Then
Dim tb As TextBox
Dim btn As Button
Dim row As FormViewRow = fvTickler.Row
If fvTickler.CurrentMode = FormViewMode.ReadOnly Then
tb = row.FindControl("txtExpireDate")
If (Not tb Is Nothing) Then
If tb.Text <> "" Then
If CDate(tb.Text) < CDate(System.DateTime.Today()) Then
'Tickler expired prior to today so make form
background red
fvTickler.RowStyle.BackColor = Drawing.Color.Red
End If
.....
Thanks.
David