For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > September 2004 > Re: How to access: a page from a User control, and another User control from another









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 Re: How to access: a page from a User control, and another User control from another
Shiva

2004-09-30, 11:37 am

Hi,

UserControl.Page property gives you the reference to the containing page.

One way to access an user control from another (both on the same page) is to
use the page-usercontrol hierarchy itself. If for example PAGE1 contains UC1
and UC2 (both are public), from UC1, DirectCast(Me.Page, PAGE1).UC2 gives
you access to UC2.

HTH.

"qwerty" <x@y.zzz> wrote in message
news:415bd7fd$0$3665$39db0f71@news.song.fi...
I have two User controls in a page.
Them ID-propertys are example UC1 and UC2.

In code behind file they are declared:
Public UC1 As UC1
Public UC1 As UC1

From the page I can call them with their name (UC1 and UC2) and access
their public propertys and functions.

How can I access the page from a user control?
How can I access another user control from another one?


Sponsored Links







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

Copyright 2010 codecomments.com