//
获得父页面
Page p = this .Parent.Page; Type pageType = p.GetType(); // 父页面的方法名 MethodInfo mi = pageType.GetMethod( " Loading " ); // 执行 mi.Invoke(p, new object [] { " 参数1 " , " 参数2 " }); 用户控件与用户控件之间调用:
//
获得父页面
Page p = this .Parent.Page; // 获得父页面的子控件 UserControl uc = p.FindControl( " tj_ReceiptList2 " ) as UserControl; Type pageType = uc.GetType(); // 父类方法名 MethodInfo mi = pageType.GetMethod( " Loading " ); // 参数 mi.Invoke(uc, new object [] { " 参数1 " , " 参数2 " }); |
转载于:https://www.cnblogs.com/yongheng178/archive/2008/08/22/1274294.html