我可以控制 imagebutton:
...
ImageButton btn;
public MyControl()
{
btn = new ImageButton();
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Page.RegisterRequiresPostBack(this);
}
protected override void CreateChildControls()
{
btn.Height = Height;
btn.Width = Height;
btn.Click += new System.Web.UI.ImageClickEventHandler(RaiseLeftClickEvent);
}
private void RaiseLeftClickEvent(object sender, ImageClickEventArgs e)
{
throw new NotImplementedException();
}
当我单击按钮时,单击事件不会触发。