为什么下面的代码会导致以下错误:
System.Web.UI.WebControls.Button.OnCommand(System.Web.UI.WebControls.CommandEventArgs)' 由于其保护级别而无法访问
protected void btnSearch_Click(object sender, EventArgs e)
{
...
UpdatePanel updatePanel;
...
Button moreButton = new Button();
moreButton.ID = "moreButton";
moreButton.Text = "More";
updatePanel.ContentTemplateContainer.Controls.Add(moreButton);
moreButton.CommandName = "More";
moreButton.CommandArgument = department.ID + "|department";
moreButton.OnCommand += new CommandEventHandler(getMoreInfoCommand_Click);
...
updatePanelList.Add(updatePanel);
}
protected void getMoreInfoCommand_Click(Object sender, CommandEventArgs e)
{
}