I have created a button programmatically in asp.net and I wanted to add some eventhandler programmatically as well. I was able to do so successfully; however, I cannot figure out a way to send other arguments to the event besides the sender and eventargs. I add the event handler as shown below:
Button Button1 = new Button();
Button1.Click += new EventHandler(doSomething);
public void doSomething(object sender, EventArgs e)
{
//Do Something
}
What I would like to do is add more arguments to the 'doSomething' method and pass those arguments when I add the Event Handler to the Click event for the button. Any support is greatly appreciated.
...
Go to the complete details ...