Of course, you could get
TextBox.Text
string properties, try to parse each into
System.DateTime
using one of the methods of this structure:
Parse
,
TryParse
,
ParseExact
or
TryParseExact
; and then you could compare the points in time just using the operators '<', '>', '>=', '=' or '<=':
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[
^].
But why?
It looks like you tend to use strings representing data instead of data itself, which is a big mistake. Why not having time from whatever data source you have, comparing it, and only them display it as string properties of text boxes or anything else?
Alternatively, you can use some
DateTimePicked
instead of pretty much irrelevant text boxes. Please see:
http://www.codeproject.com/KB/webforms/DateTimePicker.aspx[
^].
—SA