1.导入用户控件的命名空间
    也就是导入usercontrol.ascx.cs中namespace后面的那部分
2.在webform.aspx.cs的page_load()中添加
        protected (usercontrol_TagName) (usercontrol_id);
3.在webform.aspx.cs中注册usercontrol的事件
    this.(usercontrol_id).(event) += new (event)Handler((usercontrol_id)_(event));

之后就可以在webform.aspx.cs中使用用户控件的属性和方法了.

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2021-11-13
  • 2021-11-24
  • 2021-05-31
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2022-02-24
  • 2022-02-13
  • 2021-07-01
  • 2021-07-07
  • 2021-12-26
  • 2021-10-03
相关资源
相似解决方案