PlaceHolder可以完全做到这点啊
你先布置好 PlaceHolder的位置。
可以添加n个control到 PlaceHolder里去
e.g:TextBox t1 = new TextBox();
t1.ID="TextBox1"; PlaceHolder1.Controls.Add ( t1); TextBox t2 = new TextBox();
t2.ID="TextBox2"; PlaceHolder1.Controls.Add (t2); t1.Text ="hello darkness my old friends";
t2.Text ="i have taken with you again";
你先布置好 PlaceHolder的位置。
可以添加n个control到 PlaceHolder里去
e.g:TextBox t1 = new TextBox();
t1.ID="TextBox1"; PlaceHolder1.Controls.Add ( t1); TextBox t2 = new TextBox();
t2.ID="TextBox2"; PlaceHolder1.Controls.Add (t2); t1.Text ="hello darkness my old friends";
t2.Text ="i have taken with you again";
解决方案 »
- winform datagridview打印问题 (高手进 帮顶有分 在线等)
- 关于Oauth2.0 服务端的请教各位大侠
- aps.net +orcle 数据库连接问题点
- 把GridView中的内容导入Excle中文显示乱码,用 BinaryWriter 的方法写入
- 有没有使用动易BizIdea做网站的
- asp.net下GRIDVIEW控件的单据明细数据录入时刷新问题
- 浏览器的title上的图标怎么显示自己想要的?用asp.net
- 我要对<%# DataBinder.Eval(Container.DataItem,"字段")%>获取的字符串切割处理
- C# 引用KindEditor 出现的编辑框没有操作菜单
- 关于水晶报表的认识!
- 请教各位老大!!!asp这段代码化成asp.net该怎么写呀???
- 关闭进程?
TabStripDetails tab = (TabStripDetails)portalSettings.DesktopTabs[i]; if (PortalSecurity.IsInRoles(tab.AuthorizedRoles)) {
authorizedTabs.Add(tab);
} if (addedTabs == tabIndex) {
tabs.SelectedIndex = addedTabs;
} addedTabs++;
}
2。对于已定义的控件,可以用它FindControl(id)来搜索
2.可以定义一个控件组,类似:TextBox[] tb
我试过这你这种方法,确实可以达到在CS用代码增加组件的效果,
可是PlaceHolder的位置怎么布置?况且如果aspx原来就已经设计好界面,
我在后台添加的组件有没有其它方法可以控制它的位置,以达到跟原来界
面相融合的效果。
to newnan(神出鬼没):
真不好意思,看不明你的代码。to yxrj() 和asam2183(三山):
你们只是说可以,可是具体应该怎么做呀?
{
TextBox tb=(TextBox)this.FindControl("TextBox"+i);
tb.Text=i.ToString();
}