datalist问题

ruan_hg ruan_hg 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
aspx:
<asp:DataList ID="DataList1" runat="server" ><ItemTemplate ><table><tr><td><a href="detail.aspx?s1=<%#DataBinder.Eval(Container.DataItem,"id1") %>"><%#DataBinder.Eval(Container.DataItem,"dt1") %></a></td><td><asp:LinkButton ID="Button1" Text=" 删" runat="server" CommandName="delete"/></td></tr></table></ItemTemplate>
</asp:DataList>
cs:
private void DataList1_DeleteCommand(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
// Code to delete the item from the data source.
DataTable aTable = (DataTable)DataList1.DataSource;
aTable.Rows[e.Item.ItemIndex].Delete();
// Bind the data after the item is deleted.
DataList1.DataBind();
}
现在页面上的删除按钮点上去没反应
...全文
评论 17
收藏 已收藏
分享
返回顶部
ruan_hg
C# 111,129 成员 642,538 内容