You have to go through their common element - the page:
Say your page is something like:
<uc1:control1 id="firstControl" runat="Server" />
<uc3:control2 id="secondControl" runat="Server" />
and your codebehind:
public class WebForm1
inherits System.Web.UI.Page
public firstControl as Control1
public secondControl as Control2
sub page_load
...
end sub
end class
you can access the "globalPageId" in firstControl from secondControl via
(this is secondControl):
sub page_load
dim pageId as string = ctype(Page, WebForm1).firstControl.globalPageId
end sub
that's it. Now, you might wanna make sure that Page is of type WebForm1 -
since user controls are meant to be used on multiple pages...but that's the
general idea...
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Darrel" <no*****@nospam.com> wrote in message
news:uP**************@TK2MSFTNGP09.phx.gbl...
I'm really stuck on the concept of using public variables to pass
information between usercontrols. I'm pretty sure I'm just flubbing up the
syntax.
This is what I want:
page
usercontrol 1 - set variable
usercontrol 2 - read variable
I haven't been able to find a tutorial that addresses this issue. It has
been suggested that I use pulic variables, however.
Unfortunately, I'm stumped on the syntax.
I have this in usercontrol 1:
public globadlPageID as String = "2"
But I'm not sure how to access that from Usercontrol 2. Is there a way to
grab something from another control?
-Darrel