RT      ( 必须在后台 )          ps:该用户结贴很积极     

解决方案 »

  1.   

    TextBox txt=new TextBox();
    txt.id="txt";
    txt.width="20";
    txt.heigth="20"
      

  2.   

    先建好,再添加,最好用表格定位TextBox tb=new TextBox();
    this.Controls.Add(tb);如果是表格,TableCell.Controls.Add(tb);
      

  3.   

      如何这样添加?
      后台: public string aa = "<asp:TextBox runat='server' ID='txt" Width='130px'></asp:TextBox>"
      前台: <%=aa.ToString() %>
      

  4.   

    2楼的是正确的,不过你要注明一下TableCell的runat="server"
      

  5.   

      这是根据下拉框来添加文本框 ,也就是动态的添加。
      
      所以我用的 aa += "<br/><center>"+text.ToString()+"<asp:TextBox runat='server' ID='txt" + index + "' Width='130px' Visible='true'></asp:TextBox></center>";
     
      text:每次选中的下拉框的值
      但是只显示不同text的值,却没文本框,但是将aa复制到前台,却能显示文本框,真的不能这么写?愁啊...
      

  6.   

    使用literal控件 <asp:Literal ID="Literal1" runat="server"></asp:Literal>
      

  7.   

    div.innerHtml使用<input type='text'类型
    否则TextBox txt=new TextBox();
    txt.id="txt";
    this.Controls.Add(txt);
      

  8.   

    使用HtmlGenericControl html的InnerHtml方法,然后给前台的一个Lable.text= html.InnerHtml;这样就行了;  html.InnerHtml="<a href='http://baidu.com'>百度</a>";
      

  9.   

    怎么注明tablecell的run=server属性