Reach another function in a usercontrol

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
 
M

Marina

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

Micke Palm

Aha, so I need a property. Ok I supspect something like that, but somedays
are harder than others ;)

/Thanks, Micke
 

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,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top