Hello,
You can use the following code:
Control usercontrolobject = Page.LoadControl("<virtual path>");
System.Type typeUserControl = null;
System.Reflection.MethodInfo methodUserControl = null;
typeUserControl = usercontrolobject.GetType();
methodUserControl = typeUserControl.GetMethod("WriteHelloWorld");
string returnValue = (methodUserControl.Invoke(usercontrolobject, null)).ToString();
I hope this will help you.
Best regards,
Michal Legen