用户控件调用父页面方法

1.反射

            //用反射方法动态调用父页面的方法
            System.Web.UI.Page p = this.Page;
            Type pageType = p.GetType();
            MethodInfo mi = pageType.GetMethod("TestMethod");
            mi.Invoke(p, new object[] { "test" });

2.this.Page转换

WebForm1   form   =   (WebForm1)this.Page;

3.接口

在控件中暴露一个Father的属性

        protected void Page_Init(object sender, EventArgs e)
        {
            Share_budgetchargetype1.Father = this;
            Share_engineer1.Father = this;
        }

原文地址:https://www.cnblogs.com/zyizyizyi/p/2497841.html