页面放一个placeholder
然后再在placeholder里加Control
HtmlButton myButton = new HtmlButton();
myButton.InnerText = "Button 1";
PlaceHolder1.Controls.Add(myButton);
然后再在placeholder里加Control
HtmlButton myButton = new HtmlButton();
myButton.InnerText = "Button 1";
PlaceHolder1.Controls.Add(myButton);
解决方案 »
- 文字编辑菜单和预览功能怎么实现?
- ComponentArt.Web.UI TreeView的使用
- asp.net问题,寻求帮助!
- ★★★★100分,求一服务器软硬件配置清单。
- 请问自定义控件中怎么捕捉键盘的动作?
- gridview问题
- 在自己机子上开发了web项目,想发布到另一台机子(服务器)进行测试。如何发布
- 我需要一个全体成绩录入功能的页面,可是datagrid不能成列的录入分数,怎么办呀?
- sourcesafe6.0d有多大,还有就是他的serial nubmer是多少
- 快救救我,解决了立马给分。分析器错误信息: 在应用程序级别以外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。导致
- 一个web应用的性能测试问题!
- 模板编辑列中的dropdownlist,在update命令中取不到选择值,始终返回第一个直,怎么回事??
我试过直接在page上加,可报出button必须是 runat server 的提示错误
TextBox t=new TextBox();
t.Text ="5";
this.Controls[1].Controls .Add(t);
btn.Text="我的按钮";
Page.Controls[1].Controls.Add(btn);指定位置可以用css绝对定位来实现:btn.Style.Add("position","absolute");
btn.Style.Add("top","80px");
btn.Style.Add("left","200px");
这样Page.Controls[1].Controls.Add(btn);就可以
这是为什么?