2012-02-16 40 views

回答

0

在頁面中添加一個面板或div,並在後面的代碼中創建控件。將這些控件添加到面板/ div,如下所示。

Label testLabel = new Label(); 
testLabel.ID = "TestLabel"; 
testLabel.Text = "Test"; 
this.TestPanel.Controls.Add(testLabel); 

TextBox testTextBox = new TextBox(); 
testTextBox.ID = "TestTextBox"; 
this.TestPanel.Controls.Add(testTextBox); 

希望這有助於!

相關問題