Author: ProgrammerOneDay | Posted on: 4/21/2010 7:00:20 PM | Views : 350

I have a user control
I need to call a method in the parent page .
I tried this
Type pageType = this.Parent.Page.GetType();
        object o = Activator.CreateInstance(pageType);
        MethodInfo mi = this.Parent.Page.GetType().GetMethod("BindData", BindingFlags.Public | BindingFlags.Instance);
        if (mi!=null)
            mi.Invoke(o, new Object[] { });
but getting an error
Exception has been thrown by the target of an invocation.
How can I solve this.

...

Go to the complete details ...