Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Time not being found in dropdownlist


Message #1 by "Greg Quinn" <greg@i...> on Wed, 16 Oct 2002 14:25:40 -0700
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

  Return to Index