throgh前端输入动态文本框值如何获取它 [英] throgh front end enterd dynamic textbox values how to get it
本文介绍了throgh前端输入动态文本框值如何获取它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Table table = new Table();
table.ID = "Table1";
Page.Form.Controls.Add(table);
推荐答案
据我所知,您正在添加这样的文本框:
Hi,
As per I can see, you are adding the textboxes like this:
TextBox tb = new TextBox();
tb.ID = "txtBox1" + i.ToString();
cell.Controls.Add(tb);
row.Cells.Add(cell);
非常容易获得值.只需编写以下代码:
Very easy to get the values. Just write the following code:
for (int i = 0; i < 10; i++)
{
TextBox tb = (TextBox)form1.FindControl(("txtBox1" + i.ToString()));
string value = tb.Text; //Here you'll get your value of each textbox.
}
祝一切顺利.
--Amit
All the best.
--Amit
这篇关于throgh前端输入动态文本框值如何获取它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文