Capturing commandname and commandargument from imagebutton created dynamically
I have a class file which dynamicall builds a table that includes imagebuttons. I then call the method from my webpage and load the table control as in the following (i'm only showing relative code here):
public table table1(int id)
imagebutton button = new imagebutton();
button.commandname = "myCommandName"
ImageButtonCommand(object sender, CommandEventArgs e)
if(e.commandname = "MyCommand")
// fire some event
So the crux my issue is how do I get the imagebutton created in machines.cs to fire the ImageButtonCommand event handler when clicked? I looked up examples where they recommended adding the OnCommand attribute to the imagebutton (and I used to do that in VB.NET 1.x) but in C# under the 2.0 framework, it seems like the OnCommand attribute is gone.
Thanks in advance.
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.