For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET Building Controls > January 2005 > Accessing Controls contained in another Control from ASPX Page









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Accessing Controls contained in another Control from ASPX Page
Willy

2005-01-16, 8:59 pm

Hi All!

Is there any ways to get access to the controls contained in another user
controls from an ASP.NET page?

For example I have...

- User Control A
|_ User Control B (which uses User Control A)
|_ User Control C (which uses User Control B)
|_ ASPX page A (which uses User Control C)

So, is it possible for ASPX page A to get access to User Control A that is
contained in the User Control C (apart from exposing via a public property)
?

Any help or pointers are greatly appreciated!

Thank you all in advance.

willy


Willy

2005-01-16, 8:59 pm

anybody?

willy

"Willy" <112334@catchit.com.com.cmz> wrote in message
news:uv8XlFz5EHA.2572@tk2msftngp13.phx.gbl...
> Hi All!
>
> Is there any ways to get access to the controls contained in another user
> controls from an ASP.NET page?
>
> For example I have...
>
> - User Control A
> |_ User Control B (which uses User Control A)
> |_ User Control C (which uses User Control B)
> |_ ASPX page A (which uses User Control C)
>
> So, is it possible for ASPX page A to get access to User Control A that is
> contained in the User Control C (apart from exposing via a public
> property) ?
>
> Any help or pointers are greatly appreciated!
>
> Thank you all in advance.
>
> willy
>



Karl Seguin

2005-01-16, 8:59 pm

I have an article on this kinda thing:
http://www.openmymind.net/communication/index.html
but it'll just tell you to use a property...why you don't want to do this is
beyond me...

you can use FindControl(xxx).FindControl(xxxx).FindControl(xxxx) but that's
a horrible choice as (a) it's error prone (b) can easily break

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Willy" <112334@catchit.com.com.cmz> wrote in message
news:uv8XlFz5EHA.2572@tk2msftngp13.phx.gbl...
> Hi All!
>
> Is there any ways to get access to the controls contained in another user
> controls from an ASP.NET page?
>
> For example I have...
>
> - User Control A
> |_ User Control B (which uses User Control A)
> |_ User Control C (which uses User Control B)
> |_ ASPX page A (which uses User Control C)
>
> So, is it possible for ASPX page A to get access to User Control A that is
> contained in the User Control C (apart from exposing via a public

property)
> ?
>
> Any help or pointers are greatly appreciated!
>
> Thank you all in advance.
>
> willy
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com