btnQuestionNum= new Button(); btnQuestionNum.Text = Convert.ToString(i + 1); btnQuestionNum.ID = i.ToString(); btnQuestionNum.Click += new EventHandler(btnDynamic); placeholder.Controls.Add(btnQuestionNum);
btnQuestionNum.Click += (sender, e) => { MyHandler(sender, e, i); }; void MyHandler(object sender, EventArgs e, int i) { //use int i here }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)