如何将手写的table里的控件的值插入到数据库? 自己写了个<asp:table id="Table2" runat="server" CellSpacing="1" CellPadding="0" BackColor="#cccccc" Width="780"></asp:table>然后在里面写了几个TextBox.怎样才能把TextBox里值插入到数据库呢?谢谢大家了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接insert吗?但我是手写控件 TableRow tr = new TableRow();TableCell tc = new TableCell();TextBox txt2 = new TextBox();txt2.ID = "txtFu"+this.Table2.Rows.Count;tc.Controls.Add(txt2);tr.Cells.Add(tc);this.Table2.Rows.Add(tr);我是这样的 string ss;TextBox tt=new TextBox();tt=(TextBox)Table2.findcontrol(ID);ss=tt.text;我是这样想的不知道对不对。 你是程序创建的textbox么?如果是的话page_load函数里就算是postback还是要创建一次,这样才能访问到,或者你把table放到一个placeholder里也行 我现在的问题是如何才能得到文本框里的值。TableRow tr = new TableRow(); TableCell tc = new TableCell(); TextBox txt2 = new TextBox(); txt2.ID = "txtFu"+this.Table2.Rows.Count; tc.Controls.Add(txt2); tr.Cells.Add(tc); this.Table2.Rows.Add(tr);手动创建的table和控件,不知道该怎么获取。我用viewstate,request呀都得到的是空值 谁有可以运行的用C#做的基于.net的网上鲜花订购系统啊 asp.net操作xml问题 asp.net是? 高分求C#中ASP。NET中gridview增加一行的源码 求救!!!从 Enum 到 DateTime 的转换无效 100分求助:模式对话框的问题? 求在.cs中的Session问题解决 使用C#动态添加XML文档的有关问题。 菜鸟提问? 网页中如何直接调用本地应用程序?讨论! 紧急求助:三个页面同时打开,可不可以在操作一个页面的时候,进行的操作动态反应在另两个页面上,三个页面实现联动 .net下做ORM数据库用什么好点?nbear?nhibernate
TableCell tc = new TableCell();
TextBox txt2 = new TextBox();
txt2.ID = "txtFu"+this.Table2.Rows.Count;
tc.Controls.Add(txt2);
tr.Cells.Add(tc);
this.Table2.Rows.Add(tr);
我是这样的
string ss;
TextBox tt=new TextBox();
tt=(TextBox)Table2.findcontrol(ID);
ss=tt.text;
我是这样想的
不知道对不对。
TableRow tr = new TableRow();
TableCell tc = new TableCell();
TextBox txt2 = new TextBox();
txt2.ID = "txtFu"+this.Table2.Rows.Count;
tc.Controls.Add(txt2);
tr.Cells.Add(tc);
this.Table2.Rows.Add(tr);
手动创建的table和控件,不知道该怎么获取。我用viewstate,request呀都得到的是空值