我有代码,在那里我编程添加ImageButton到表,我需要将事件处理程序分配给此ImageButton。当我编写ASP/HTML代码时,有属性OnCommand,但在C#中,没有这样的东西。只需CommandName和CommandAttribute。如何以编程方式为ImageButton添加EventHandler OnCommand?
ImageButton ib = new ImageButton
{
CommandName = "Edit",
CommandArgument = id.ToString(),
ImageUrl = "~/Images/icons/paper_pencil_48.png",
AlternateText = "Edit document"
};
伟大,谢谢你们。 ;) – Andree643 2010-10-02 10:55:35