在上面的照片中,我有一个表格,其中包含在表格中动态添加的用户列表。我希望当我单击红十字图像按钮时,要从数据库中删除相应的用户。
这是填写表格的代码:
/****** Filling the originators table ********/
string[] oa1 = originator;
for (int i = 0; i < oa1.Length; i++)
{
TableRow row = new TableRow();
users_table.Rows.Add(row);
for (int colCount = 0; colCount < 4; colCount++)
{
TableCell cell = new TableCell();
row.Cells.Add(cell);
if (colCount == 0)
{
cell.Controls.Add(new LiteralControl(oa1[i]));
}
else if (colCount == 1)
{
cell.Controls.Add(new LiteralControl("|"));
}
else if (colCount == 2)
{
LLKB userInfo = new LLKB();
cell.Controls.Add(new LiteralControl(userInfo.InfoGetter(oa1[i].Trim(), "name")));
}
else if (colCount == 3)
{
ImageButton btn = new ImageButton();
btn.ImageUrl = "img/DeleteRed.png";
btn.ID = oa1[i] + "_" + i;
btn.Click += new ImageClickEventHandler(delete_originator);
cell.Controls.Add(btn);
}
}
}
这是显示删除的方法:
public void delete_originator(object sender, ImageClickEventArgs e)
{
//some code here
}
那么,你建议我在删除方法中写什么?
或者如果你有其他想法...