I want a 'delete' asp link button created dynamically, for each record that I display in my table. I am getting a compilation error:
Error 1 Cannot implicitly convert type 'void' to 'string' on line 5
Here is my code, please check and suggest correction:
1. TableCell deleteCell = new TableCell();
2. LinkButton btnLnk = new LinkButton();
3. btnLnk.Text = "Delete";
4. btnLnk.Visible = true;
5. btnLnk.CommandName = DeleteRecord(bloodGlucose.Key.Id.ToString());
6. deleteCell.HorizontalAlign = HorizontalAlign.Center;
7. row.Cells.Add(deleteCell);
15. void DeleteRecord(String KeyID)
16. {
17. Guid ItemID = new Guid(KeyID);
18. BloodGlucose bg = (BloodGlucose)PersonInfo.SelectedRecord.GetItem(ItemID, HealthRecordItemSections.Xml);
...
Go to the complete details ...