Author: clay_mckinney | Posted on: 12/8/2009 11:12:40 AM | Views : 338

I am using the CheckBoxList.Items.FindByText() method, but it always returns null. My CheckBoxList is built from a DB, and returns a list of AreaIDs. I have another table called CustomerAreas, with CustomerId and AreaId. For the Customer accessing the page, I want all their areas to be checked.

The datasource is working, the for each loop is working, only the FindByText line is always returning null.

I have taken the code out of my app and put it in a new project. I've stripped it down to only the relevant bits. What am I doing wrong?


<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %> <!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> <headrunat="server"> & ...

Go to the complete details ...