1 在用户控件中访问主页面中的服务器控件:

用户控件与主页面之间交换变量   TextBox tb = (TextBox)Page.FindControl("TextBox1");
用户控件与主页面之间交换变量   
if(tb != null)
   }

2 在主页面中访问用户控件中的变量或方法:

用户控件与主页面之间交换变量  protected QueryOrderModule ModuleQuery;
用户控件与主页面之间交换变量
用户控件与主页面之间交换变量  ModuleQuery.DisplayQueryInfo (
false);

3 也可在用户控件中新建公共的属性或方法

相关文章:

  • 2022-12-23
  • 2022-01-31
  • 2021-06-24
猜你喜欢
  • 2021-07-14
  • 2021-11-04
  • 2021-12-20
  • 2021-12-01
  • 2021-07-19
相关资源
相似解决方案