Hello,
I have a datalist control on a webform, in that datalist I am using the Footer template as my 'add new' section. They type in the data into the text boxes, etc and then press save. When the user presses save, I get this error msg: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index The 'e.Item.ItemIndex' value is -1 in the Watch (debugging) window as I step through the code. How do I set it to editMode??
Here is the line it is 'blowing up' on.:
Any help would be greatly appreciated!!!! Thanks in advance.
I have a datalist control on a webform, in that datalist I am using the Footer template as my 'add new' section. They type in the data into the text boxes, etc and then press save. When the user presses save, I get this error msg: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index The 'e.Item.ItemIndex' value is -1 in the Watch (debugging) window as I step through the code. How do I set it to editMode??
Here is the line it is 'blowing up' on.:
Code:
tbFailMode = CType(DataList1.Items(e.Item.ItemIndex).FindControl("tbFooterFailureMode"), TextBox)