Reach another function in a usercontrol

  • Thread starter Thread starter Micke Palm
  • Start date Start date
M

Micke Palm

Hi!

I have set up one aspx page and I using a few usercontrols to this page. The
treestructure is like below...
aspx
/ \
uCtrl1 uCtrl2
\
uCtrl3

In uCtrl3 I have a public sub with name Test() , now I need to reach this
sub from uCtrl2.
Dim myTestClass as New uCtrl3
myTestClass.Test

Do I need to use "New" coz if I use "New" all control will be NULL? In
uCtrl3 I also have an Table control and here everything goes wrong. When I
use "New" it can't found the Table control and if I don't use "New" it can't
found the class.
I can solved this with other ways like set Panels visible when a criteria is
set, but I think this is a nicer way to do this call or may I've wrong?

/regards, Micke
 
Basically, uCtrl2 needs to have a public property that points to its uCtlr3
instance. uCtrl3 needs to have the method you want to call be public.
Then the page can use its uCtrl2 instance, to get to uCtrl3 instance, and
then call the method.
 
Aha, so I need a property. Ok I supspect something like that, but somedays
are harder than others ;)

/Thanks, Micke
 
Back
Top