I have a form that searches all rows in a single table (TServices) that occurred between the date range and then populates a dynamic table below the form.
Now I'm adding a delete ImageButton next to each listing in the table. Here's my C# code-behind for adding the ImageButtons to the table cell:
ImageButton btnRemoveService = new ImageButton();
btnRemoveService.EnableViewState = true;
btnRemoveService.ImageUrl = "/images/icons/trash.gif";
btnRemoveService.Click += new ImageClickEventHandler(btnRemoveService_Click);
btnRemoveService.ID = "btnRemoveService-" + row["BillingID"].ToString();
btnRemoveService.CommandArgument = row["BillingID"].ToString();
tblCell.Controls.Add(btnRemoveService);
Even if I put nothing in btnRemoveService_Click(), all my data from the dynamic table disappears. When I put in the code to actually delete the stored procedure, the data disappears from the dynamic table and nothing is changed in the db.
Edit: I moved the populate code into its own function and called it at the end of btnRemoveService_Click(). Shouldn't this reload the data?