Good day i want to pass a value to a onclick button method :
This is my dynamically created button :
string Code = //Some value
Button button = new Button();
button.ID = "Start";
button.Click +=new EventHandler(button_Click);
button.CommandArgument = Code;
Page.Controls.Add(button);
this my event method :
void button_Click(object sender, EventArgs e)
{
string code = //Put the value in code
}
Thanks.