Calling parent methods from a child

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a user control that has two nested user controls within it. I have a
method in the parent called CloseDetailsMaint, and I need to be able to call
it from one of the child user controls that is nested within the parent. How
do I do this?
 
Parent.Page
You may have to cast it, and make sure it's set to Public in the parent
 
I tried Parent. Page.CloseDetailsMaint ();, but I got an exception during the
build saying that System.Web.UI.Page does not contain a definition for
"CloseDetailsMaint". Any ideas? The method is public and returns void.
 
((MyParentPage)Page).CloseDetailsMaint ();



Jim said:
I tried Parent. Page.CloseDetailsMaint ();, but I got an exception during
the
build saying that System.Web.UI.Page does not contain a definition for
"CloseDetailsMaint". Any ideas? The method is public and returns void.
 
You can Raise an Public Event in the child control, and this event is
implemented in the parent control, and there you can call the method you
need.

Atte. Elmer Carías
 
Back
Top