当前位置: 代码迷 >> ASP.NET >> asp.net调用控件,该怎么处理
  详细解决方案

asp.net调用控件,该怎么处理

热度:7385   发布时间:2013-02-25 00:00:00.0
asp.net调用控件
a.ascx控件
在b页面中调用
在b.aspx.cs写一个b();
b()
{
Control c1 = LoadControl("a.ascx"); 
   
  Page.Controls.Add(c1); 
}
后在页面中调用.结果没用.请老师帮忙.要简单点啊.js也行

------解决方案--------------------------------------------------------
探讨
用了namhyuk的
public void b()
{
PlaceHolder PlaceHolder1 = new PlaceHolder();

Control ctrl = Page.LoadControl("a.ascx");
PlaceHolder1.Controls.Add(ctrl);
}
然后在面中用 <%b();%>没有显示控件
  相关解决方案