在我的网络表单中,我从后面的代码创建了按钮:
Button btnShowCase = new Button();
btnShowCase.ID = "btnShowCase_" + ticketNumber;
btnShowCase.CssClass = "BtnShowCase";
btnShowCase.Text = "Display";
btnShowCase.OnClientClick = "ShowCase";
在客户端点击我想执行功能
protected void ShowCase(object sender, EventArgs e)
{
Do something
}
OnClientClick不要调用ShowCase。我做错了什么?