如何解决点击事件中的动态按钮未触发
我在单击按钮时无法触发onclick事件。我可以看到页面上的按钮很好,但是操作从未被调用。如果有人能指出正确的方向,我将不胜感激
// This is adding it to my existing table and trying to generate the button with the on click event
// I am looping through a list of users and trying to add an activate button for each of them
If mycount < 3 Then
litExpiredUser.Text += "<td><input type='button' onclick='btnActivate' name='Activate' value='Activate' id='btnActivate(" & USERID & ")' class='activateButton' title='Activate'></td>"
End If
Protected Sub btnActivate_Click(UserID)
{
// Performing My Activation work
// When done Calling Page Refresh to show new activations
}
// This is where I call the control to show my table on the page
<asp:Literal ID="litExpiredAccess" runat="server"></asp:Literal>
解决方法
您可以通过输入按钮来实现此目的,这很有趣
{
"2020-07-06": {
"food": {
},},"2020-07-07": {
"food": {
},"2020-07-08": {
"food": {
},}
Expected output:
{
"date": "2020-07-06","food": {
},"date": "2020-07-07","date: "2020-07-08",}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。