Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Reach another function in a usercontrol

Reply
Thread Tools

Reach another function in a usercontrol

 
 
Micke Palm
Guest
Posts: n/a
 
      05-04-2004
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


 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      05-04-2004
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.

"Micke Palm" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Micke Palm
Guest
Posts: n/a
 
      05-04-2004
Aha, so I need a property. Ok I supspect something like that, but somedays
are harder than others

/Thanks, Micke

"Marina" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
> "Micke Palm" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public struct in usercontrol, can't reach items Edwin Knoppert ASP .Net 1 12-05-2006 09:49 AM
Reach UserControl from ASPX codebehind? Özden Irmak ASP .Net Building Controls 3 06-30-2005 02:46 PM
stuck: I cant reach usercontrol's class .. Support ASP .Net Web Controls 1 04-01-2005 06:47 PM
stuck: I cant reach usercontrol's class .. Support ASP .Net 2 03-24-2005 04:35 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM



Advertisments