I'm pulling the time portion of a datetime field from a SQL Server database.
After a bit of formatting I'm eventually ending up with exactly 8:00 AM
I assign the 8:00 AM to the variable RemindOnTimeValue
Now my dropdown list has a listitem
<asp:listitem>8:00 AM</asp:listitem>
But when I try to use
timeList.Items.FindByValue(RemindOnTimeValue).Selected = true
I get the error 'object reference not set to instance of object' which
obviously means it can't find 8:00 AM in the dropdownlist.
But I've looked at the string carefully and they are both the same length
everything.
I've even tried using
RemindOnTime.Items.FindByValue("8:00 AM").Selected = true
And this works. So what is the problem here???
Greg