public partial class RapportRowControl : System.Web.UI.UserControl { // Gets fired from the Page_Load of the owning WebPage. public void LoadByRapportRow(tblRapportRow row) { PlaceHolder1.Controls.Clear(); HanDataContext dc = new HanDataContext(); var list = from a in dc.tblCategories where a.lng_prf_ID == row.tblRapport.lng_prf_ID select a; Table t = new Table(); foreach (var item in list) { LinkButton CategorieLink = new LinkButton(); CategorieLink.EnableViewState = true; CategorieLink.ID = item.lng_ctg_ID.ToString(); CategorieLink.CommandName = item.lng_ctg_ID.ToString(); CategorieLink.Text = item.str_ctg_Naam; CategorieLink.Click += new EventHandler(CategorieLink_Click); TableRow tr = new TableRow(); TableCell td = new TableCell(); td.Controls.Add(CategorieLink); tr.Cells.Add(td); t.Rows.Add(tr); } PlaceHolder1.Controls.Add(t); } // ===== DOESN'T FIRE AT ALL ===== private void CategorieLink_Click(object sender, EventArgs e) { ActiveRow.lng_ctg_ID = Convert.ToInt32(((LinkButton)sender).CommandName); } // ===== DOESN'T FIRE AT ALL ===== }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)