Button btn = new Button();
btn.Text = "按钮A";
Panel1.Controls.Add(btn);

解决方案 »

  1.   

    网页中放一个Table控件,可以在程序中动态的调整Table,在TableCell中可以AddControl,
    添加的对象就可以是如Lable,Button之类的控件.
      

  2.   

    就是上面我说的啊,用Table,在TableCell中添加控件
      

  3.   

    动态添加表格行Function AddRow(ByVal i, ByVal tr1)        Dim td1 As New TableCell()
            Dim td2 As New TableCell()
            Table2.CellPadding = 0
            Table2.CellSpacing = 0        tr1.BackColor = Color.LightGray        td1.HorizontalAlign = HorizontalAlign.Center
            td2.HorizontalAlign = HorizontalAlign.Center
            td1.VerticalAlign = VerticalAlign.Middle
            td1.BorderColor = Color.Black
            td2.BorderColor = Color.Black        td1.BorderWidth = Unit.Pixel(1)
            td2.BorderWidth = Unit.Pixel(1)        Dim txtXx As New TextBox()
            txtXx.Width = Unit.Pixel(50)
            txtXx.ID = "xx" + i.ToString()
            td1.Text = "option" + i.ToString()
            td2.Controls.Add(txtXx)        tr1.Cells.Add(td1)
            tr1.Cells.Add(td2)        Table2.Rows.Add(tr1)    End Function
        Function addrow2(ByVal i)
            Dim txtXx As New TextBox()
            txtXx.Width = Unit.Pixel(10)
            txtXx.ID = "xx" + i.ToString()
            Page.Controls.Add(txtXx)
        End Function
        Function add3(ByVal tr As TableRow)
            Dim txtXx As New TextBox()
            txtXx.Width = Unit.Pixel(100)
            txtXx.ID = "xx" + i.ToString()
            txtXx.Text = "option" + i.ToString()        Dim td As New TableCell()
            td.Controls.Add(txtXx)
            tr.Cells.Add(td)
            Table2.Rows.Add(tr)
        End Function
      

  4.   

    Button btn = new Button();
    btn.Text = "按钮A";
    Page.Controls.Add(btn);