1.用using引入UserControl的命名空间.
2.在需要放置UserControl的地方添加一个PlaceHoler用来占位.
3.代码
BaseSubjectModule mdlBaseSubject = (BaseSubjectModule)LoadControl(@"Module\BaseSubjectModule.ascx"动态加载UserControl~;//加载
mdlBaseSubject.BindType();//执行该UserControl的方法
ph.Controls.Clear();//清空容器
ph.Controls.Add(mdlBaseInfo);添加到容器中

4.说明
BaseSubjectModule :UserControl的类名称;
ph:PlaceHolder的实例

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-02-16
  • 2022-02-01
  • 2021-09-03
  • 2022-02-23
  • 2022-01-13
猜你喜欢
  • 2021-07-09
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案