使用C#反射实现用户控件调用父页面方法

using System.Reflection; 
MethodInfo mi =  this.Page.GetType().GetMethod("GetUserName"); //该处的GetUserName是父页面里的方法名称
        int userId=5;       
        return mi.Invoke(p, new object[] {userId}).ToString();  //userId指的指的是GetUserName所要传递的参数。
原文地址:https://www.cnblogs.com/qq1223558/p/3156542.html