我又一个表单里面放了placeholder,用户可以点击按钮在placeholder中添加文本框之类的,请问如果不同的用户添加的文本框的数量肯定不同,而且都录入了信息,请问我数据库如何保存这些数据????给个思路

解决方案 »

  1.   

    循环placeholder中的控件
    =============
    我的签名
      

  2.   

    TextBox t1 = new TextBox();
    t1.Text ="aa";
    this.PlaceHolder1.Controls.Add(t1);
    TextBox t2 = new TextBox();
    t2.Text ="bb";
    this.PlaceHolder1.Controls.Add(t2); this.PlaceHolder1.Controls.Add(new Button()); foreach(System.Web.UI.WebControls.WebControl o in this.PlaceHolder1.Controls)
    {
    if(o.ToString() == "System.Web.UI.WebControls.TextBox")
    {
    Response.Write(((TextBox)o).Text +"<BR>");
    }
    }
    =============
    我的签名
      

  3.   

    我是想知道数据库中的数据怎么存放?
    我现在有个想法,是否可以用datagrid替代实现??
      

  4.   

    cpp2017(幕白兄)说的很好呀,楼主不厚道
    数据库里怎么存放要看你的具体情况吧,如果文本框数量没有限制,应该分多条记录存储吧