How can I launch Page_Load event in a WebUserControl?

see07

Regular
Joined
Apr 16, 2004
Messages
78
Location
Mexico City
Hello everybody:

Now I’m using 2 WebUserControls in the window.

When an user clicks a button placed into WebUserControl 1, I need to launch the Page_Load event of WebUserControl 2. How can I do this?

I attempted launch Page_Load event of WebUserControl 2 from a button inside WebUserControl 1 thus

IntranetV2.ConsultaPeticIntra.Peticion parent = (IntranetV2.ConsultaPeticIntra.Peticion) this.Page;
parent.Page_Load(sender, e);

In WebUserControl 2 I have:

namespace IntranetV2.ConsultaPeticIntra

public abstract class Peticion : ASPNetPortal.PortalModuleControl

When I compile the project send the errors: CS0030 and CS0246.

What is wrong with this?

Are there somebody to help me?

I suspect it is because Peticion is a public abstract class.

I’ll appreciate your suggestions

A.L.
 
Well... being abstract don't allow you the right to execute it.
Abstract class are used as a root to implement other classes. Derived class from the root will include functions.

If you remove abstract it'll be okay. :D
 
Because WebUserControl 1 is embebed in WebUserControl 2 the solution is place this code:
((IntranetV2.ConsultaPeticIntra.Peticion)this.Parent).Page_Load(sender, e);
in the button in WebUserControl 1
 
Back
Top