I have a dynamic button btnQuestionNum and a integer i,
btnQuestionNum= new Button();
btnQuestionNum.Text = Convert.ToString(i + 1);
btnQuestionNum.ID = i.ToString();
btnQuestionNum.Click += new EventHandler(btnDynamic); placeholder.Controls.Add(btnQuestionNum);
I want to pass the value of i when button btnQuestionNum is clicked.
How to pass an Integer value with button_click eventhandeler
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 10, 2013, 3:31 AM EDT
So you can try something like this.
In Your btnDynamic event
{
HyperLink control=(HyperLink)sender;
int i=control.ID;
}