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
|
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
|
Rank: Member Groups: Member
Joined: 6/17/2007 Posts: 17
|
Just what I needed!
Thanks
|