我正在面板内创建链接按钮并将事件处理程序连接到 Click 事件。它没有开火。这是我的代码。这是在回发时丢失的吗?
foreach (var item in clients)
{
var codeLb = new LinkButton() { Text = item.CLIENT_CODE, CssClass = "codeColumn", CommandArgument = item.CLIENT_CODE, CommandName = "Select" };
codeLb.Click += ResultsLinkButton_Click;
ResultsPanel.Controls.Add(codeLb);
var nameLb = new LinkButton() { Text = item.CLIENT_NAME, CssClass = "nameColumn", CommandArgument = item.CLIENT_CODE, CommandName = "Select" };
nameLb.Click += ResultsLinkButton_Click;
ResultsPanel.Controls.Add(nameLb);
}