有两个WEB控件可以用,一个是PlaceHolder,一个是Pannel
解决方案 »
- NET--使用replace将数字转换为汉字形式
- 如何动态的显示、隐藏表格的行?
- 菜鸟问个简单问题
- asp.net的page_load时间的疑问
- 请问各位高手这是为什么?
- treeview 对应datagrid刷新的问题(急!!)
- asp.net中如何绑数据到dropDownList
- adodb.stream
- tp://ftpd.borland.com/download/csharpbuilder/csb1/csb1_per_noncommercial.exe(C# Builder 的下载地址有200多兆)(
- 怎么样在datagrid中设置超级连接,也就是说在属性的url中怎么样设置才能带数据库的字段作为参数?
- 在datagrid 时,如何分行显示
- 如何设置列宽???????在线等待!!!!!!!!!!!
Programmatic composite controls create child controls programmatically. All controls inherit a virtual CreateChildControls method from Control that can be overridden in a derived class. The .NET Framework calls CreateChildControls very early in the control’s lifetime, so it’s the perfect place to instantiate child controls. The following control is the programmatic equivalent of the declarative control presented a few moments ago—the one containing Label controls with the greetings “Hello!” and “Goodbye!”using System.Web.UI;
using System.Web.UI.WebControls;namespace Wintellect
{
public class CompositeControl : Control
{
protected override void CreateChildControls ()
{
Label label1 = new Label ();
label1.Text = "Hello!";
Controls.Add (label1);
Controls.Add (new LiteralControl ("<br>"));
Label label2 = new Label ();
label2.Text = "Goodbye!";
Controls.Add (label2);
}
}
}
In its override of CreateChildControls, CompositeControl instantiates the Label controls with new and adds them to its Controls collection with ControlCollection.Add. It also uses a Literal control to insert a <br> element between the Labels.
谢谢你的回复,我希望在设计阶段便能件控件拖入,而按这种做法只有在运行阶段才可出来!并且不能象Panel那样在设计阶段拖入控件!
http://expert.csdn.net/Expert/topic/2213/2213752.xmlit is a container and you shouldn't add controls inside the code, do it in html or drag/drop, since the system doesn't call GetDesigntimeHtml for containers