Hi,
I have an application where I can add, edit and delete items that appear in a checkboxlist. Checkboxlist items are bound to this control from a table in the database. When an item is deleted, it is flagged as such in the database and will not appear for selection.
If a user enters a request on to the system, they need to select an item from the checkboxlist. If before they try to edit the request, the chosen item in the checkboxlist is deleted, then the page displays an error when the user tries to edit the request. The error is as follows:
Object reference not set to an instance of an object.
I know why it does this, I want to know if there is a way around it. At the moment I am binding non-deleted items to the checkboxlist. Any help would be much appreciated.
SonJ
I have an application where I can add, edit and delete items that appear in a checkboxlist. Checkboxlist items are bound to this control from a table in the database. When an item is deleted, it is flagged as such in the database and will not appear for selection.
If a user enters a request on to the system, they need to select an item from the checkboxlist. If before they try to edit the request, the chosen item in the checkboxlist is deleted, then the page displays an error when the user tries to edit the request. The error is as follows:
Object reference not set to an instance of an object.
I know why it does this, I want to know if there is a way around it. At the moment I am binding non-deleted items to the checkboxlist. Any help would be much appreciated.
SonJ