用GridView或者FormView时,如果删除语句是:Delete from tTable where id=@id,然后设置了CommandName="Delete"和DataKeyName="id"以后,如果点击删除按钮就会自动传入DataKeyName参数,也就是把id值传入,就可以直接删除。但是DataList却不行,我们需要这么做才可以达到删除功能:
在DataList的ItemCommand事件中:
DataList中添加删除功能protected void dataLst_ItemCommand(object source, DataListCommandEventArgs e)
}


相关文章:

  • 2021-11-21
  • 2021-11-10
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-11-09
  • 2022-12-23
  • 2021-12-12
  • 2021-10-28
相关资源
相似解决方案