M
Mike
Hi,
I am adding controls dynamically in a WebForm and would like to handle some of their events. Here is the code to set up the dynamic controls:
System.Web.UI.WebControls.TableRow row = new TableRow();
System.Web.UI.WebControls.TableCell cell = new TableCell();
System.Web.UI.WebControls.HyperLink btn = new HyperLink();
System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
if (trk.Editable==true) {
btn.Text = " " + "Edit";
btn.Target = "WebForm1.aspx";
img.ImageUrl = "Images/img_sec/edit_pencil.gif";
cell.Height = 5;
cell.Controls.Add(img);
cell.Controls.Add(btn);
row.Cells.Add(cell);
m_Table.Rows.Add(row);
} else {
btn.Visible = false;
img.Visible = false;
}
Any idea on how to do it?
Thanks a lot.
Mike
I am adding controls dynamically in a WebForm and would like to handle some of their events. Here is the code to set up the dynamic controls:
System.Web.UI.WebControls.TableRow row = new TableRow();
System.Web.UI.WebControls.TableCell cell = new TableCell();
System.Web.UI.WebControls.HyperLink btn = new HyperLink();
System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
if (trk.Editable==true) {
btn.Text = " " + "Edit";
btn.Target = "WebForm1.aspx";
img.ImageUrl = "Images/img_sec/edit_pencil.gif";
cell.Height = 5;
cell.Controls.Add(img);
cell.Controls.Add(btn);
row.Cells.Add(cell);
m_Table.Rows.Add(row);
} else {
btn.Visible = false;
img.Visible = false;
}
Any idea on how to do it?
Thanks a lot.
Mike