且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何创建一个onClick事件处理程序用于动态创建按钮

更新时间:2023-11-23 09:17:34

您需要添加单击处理程序在每次回发的按钮。

You need to add the click handler for the button on every postback.

您可以查找按钮,在搜索学生面板上的页面加载或尝试在页面的OnInit()方法添加处理程序的创建时。

you could look for the button in the search students panel on page load or try the page OnInit() method to add the handler when its created.

也检查这里:

Dynamically添加ASP.NET按钮单击处理程序被忽略

在这里:
asp.net动态与事件处理程序按钮

在这里:
ASP:按钮的Click事件不会被解雇

(所有这些给出类似的建议)

(all of which give similar suggestions)