Welcome Guest Search | Active Topics | Sign In | Register

DatePicker Comparison Operators Options
Mikael Lehmann
Posted: Saturday, June 14, 2008 1:58:11 AM
Rank: Member
Groups: Member

Joined: 6/17/2007
Posts: 17
Hi,
I'm trying to figure out how to check if a DatePicker contains a selected date or not with something like this:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim CASEFV As FormView = caseFormView
Dim start_TB As EO.Web.DatePicker = CASEFV.FindControl("DatePicker1")

If start_TB.SelectedDate = "" Then
start_TB.SelectedDate = Today()
Else
start_TB.SelectedDate = start_TB.SelectedDate
End If

End Sub

This doesn't work of course since there is a conversion problem. But what kind of operator should i use instead?

Thanks
eo_support
Posted: Saturday, June 14, 2008 9:14:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Hi,

SelectedDate is a DateTime. So you can only compare it with DateTime. You would do:

Code: Visual Basic.NET
If start_TB.SelectedDate = DateTime.MinValue Then


Thanks
Mikael Lehmann
Posted: Sunday, June 15, 2008 12:43:23 AM
Rank: Member
Groups: Member

Joined: 6/17/2007
Posts: 17
Just what I needed!

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.