Calling parent methods from a child

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?
 
C

Curt_C [MVP]

Parent.Page
You may have to cast it, and make sure it's set to Public in the parent
 
G

Guest

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.
 
J

Jakub

((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.
 
E

Elmer Carías

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top