在new出控件对象后,使用“控件.location”属性来控制控件的位置

解决方案 »

  1.   

    可以在控件的html脚本来写了,为什么连这个都要在服务器端写呢
      

  2.   

    如:
    aspx中把PlaceHolder1放在<tr>与</tr>之间
    CodeBehind中Page_Load()中加上:
    Label Label1=new Label();
    Label1.Text="加的标签";
    TextBox TextBox1 = new TextBox();
    TextBox1.Text="文本框";
    RadioButton RB1 = new RadioButton();
    RB1.Text="选择";
    this.PlaceHolder1.Controls.Add(new LiteralControl("<td colspan=2>"));
    this.PlaceHolder1.Controls.Add(Label1);
    this.PlaceHolder1.Controls.Add(new LiteralControl("</td><td colspan=2>"));
    this.PlaceHolder1.Controls.Add(TextBox1);
    this.PlaceHolder1.Controls.Add(new LiteralControl("</td><td>"));
    this.PlaceHolder1.Controls.Add(RB1);
    this.PlaceHolder1.Controls.Add(new LiteralControl("</td><td></td>"));
      

  3.   

    ms-help://MS.VSCC/MS.MSDNVS.2052/WebControls/workshop/webcontrols/overview/multipage.htm