根据数据的条数动态创建textbox,然后在后面调用该怎么写
谢谢
谢谢
解决方案 »
- 动态加载用户控件,值怎么存起来?
- 页面使用AJAX控件,JS代码却不能执行!马上给分!!!!!!!!!
- GridView 不能分页 怎么改啊 !!!
- 掉用winrar解压文件,如何获取这个文件的所有路径或者图片列表?
- 求用正则表达式过滤风险字符
- 郁闷!脚本中使用asp:requiredfieldvalidator以后,定义的<asp:button的事件就不管用了
- 用datagrid删除记录时出错
- 请需要c#全站程序和mis oa程序的网友进来看看
- 请教喜欢较汁的朋友:这两种赋值方式,哪种更好?
- EXCEL数据导入到SQl问题
- access数据库上传到ftp服务器上,没有写数据的权限怎么办啊 ????
- 请教html表单传值问题?
txt.ID = "txt1";
Page.Controls[1].Controls.Add(txt);=======
后面如果需要取用户在txt1中输入的值,则:
string aaa = Reqeust.Form["txt1"];
如果形成5个,那这5个都一个id吗
有多少数据,数组的大小就是相应的需要创建的数量
使用的时候,通过数组的index来使用画到窗体上,就需要设置每个textbox的属性就可以了
TextBox textBox2 = new TextBox();
// Set the Multiline property to true.
textBox2.Multiline = false;
// Add vertical scroll bars to the TextBox control.
textBox2.ScrollBars = ScrollBars.Vertical;
// Allow the RETURN key to be entered in the TextBox control.
textBox2.AcceptsReturn = true;
// Allow the TAB key to be entered in the TextBox control.
textBox2.AcceptsTab = true;
// Set WordWrap to True to allow text to wrap to the next line.
textBox2.WordWrap = true;
// set TextBox POSTION
textBox2.Location.X = 10;
textBox2.Location.Y = 10;
// Set the default text of the con
this.Controls.Add(textBox2);
运行时出错:类型“TextBox”的控件“ctl02”必须放在具有 runat=server 的窗体标记内
这东西从哪改?
Response.Write("<td>")
tbx(c) = New TextBox()
tbx(c).Text = z
form1.Controls.Add(tbx(c))
Response.Write("</td>")
这样不出上面的错误,但都在表格外面横着显示