如何使用删除按钮将数据绑定到asp表 [英] how to bind data to asp table with delete button
本文介绍了如何使用删除按钮将数据绑定到asp表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用删除按钮将数据绑定到asp表
how to bind data to asp table with delete button
推荐答案
此解决方案适用于具有删除功能的表.
在.aspx页上执行asp表控件,然后在.cs页上编写以下代码.
This solution is for table with delete functionality in it.
Take asp table control on .aspx page and write below code on .cs page.
TableRow TR = new TableRow();
TableCell TD;
TD = new TableCell();
TD.Text = "Code";
TR.Cells.Add(TD);
TD = new TableCell();
TD.Text = "Description";
TR.Cells.Add(TD);
TD = new TableCell();
TD.Text = "Delete";
TR.Cells.Add(TD);
这将通过在DT上进行迭代来创建表绑定数据的标头.
删除功能,请使用LinkButton并调用javascript onClick按钮
this will create headers of table bind data by iterating on DT.
for delete functionality take LinkButton and call javascript onClick of button
LinkButton lBtn = new LinkButton();
lBtn.Text = "Delete";
lBtn.ToolTip = "Click to Delete";
lBtn.Attributes.Add("onClick", "javascript:return delConfirm(this,parameters)");
这篇关于如何使用删除按钮将数据绑定到asp表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文