【发布时间】:2014-05-07 19:03:11
【问题描述】:
我有一个动态表格,其中每一行都有一个文本框 (txtCantitate) 和一个按钮 (btnMinus)。在文本框中我有数量(int),在按钮上单击我希望数量减少一。这里有我在桌子上的东西:
你能帮我编写按钮的代码吗?问题是它是一个动态按钮...在每条记录上它都有相同的 ID...我不知道该怎么做...
我在项目中使用的语言 C#、.NET 4.5、js、Jquery。
cell = new HtmlTableCell();
HtmlInputButton btnMinus = new HtmlInputButton();
btnMinus.ID = "btnMinus";
btnMinus.Value = "-";
cell.Controls.Add(btnMinus);
row.Cells.Add(cell);
cell = new HtmlTableCell();
HtmlInputText txtCantitate = new HtmlInputText();
txtCantitate.ID = "txtCantitate";
txtCantitate.Value = publicatie.Cantitate.ToString();
cell.Controls.Add(txtCantitate);
row.Cells.Add(cell);
【问题讨论】:
标签: c# javascript jquery asp.net