Hi,<BR><BR>I have:<BR><BR>A Custom Data access object to broker database requests - dbBroker as a variable in my top level page's Code Behind.<BR><BR>My question is:<BR><BR>How do I access functions of that object from the CodeBehind page of a UserControl that is inside the page, i.e. How can I make my dbBroker component "Global" and accessible from UserControls all over my Application?<BR><BR>Thanks in advance<BR><BR>Dan Pollitt<BR>You cant do it using codebehind because your codebehind page can only inherit either control or page and not both. But what you can do is compile your own dll and put it in the /bin directory. It doesnt need to be registered. Which is just.. sweet. It just loads right up. No permission denied problems when you need to recompile it either. So what you do is create a .vb file like this...<BR><BR>Namespace thinkofanamespace<BR> class dbBroker<BR> ' methods and properties<BR> End class<BR>End Namespace<BR><BR>Save this into a directory called /components. Then make a mk.bat file to compile it like this....<BR><BR>vbc /t:library /out:..inWhateveryouwant.dll /r:System.dll /r:System.Web.dll /r:System.Xml.dll /r:System.Data.dll whateveryouwant.vb<BR><BR>There is some really cool source code that demonstrates it at www.ibuyspy.comHi,<BR><BR>I tried writing a namespace like above and got it working as I created an instance of the class within the namespace on my top level aspx page. But I cannot access this instance from within UserControls on that main page.<BR><BR>My basic problem is I want to have globally accessible objects - i.e. I want to access UserControls from other UserControls at the same level.<BR><BR>I'll see if I can diagram what I am trying to do:<BR><BR> -------------------------<BR> | MainPage.aspx |<BR> | (uses MainPage_CB.vb) |<BR> | |<BR> | has UserControls |<BR> -------------------------<BR> |<BR> -------------------------<BR> | |<BR>--------------------- ---------------------<BR>| UserControl1.ascx | | UserControl2.ascx |<BR>| uses .vb CodeBeh | | uses .vb CodeBeh |<BR>--------------------- ---------------------<BR><BR>I want to be able to access (i.e. call functions and access variables) UserControl2 from within the Code of UserControl1 - Ideally jumping up a level in the hierarchy and back down into the other control:<BR><BR>Ideally calling "Page.UserControl2.DoSomething()" from within UserControl1.<BR><BR>Please help - this is towards the practical component of my Final Year Project at University and I have run out of fingernails... )<BR><BR>Dan Pollitt<BR>The parent page object is a member of System.web.ui.control which is inherited by all controls... <BR><BR>So like this...<BR><BR>UserControl2.Page.UserControl1<BR><BR>If it works let us know.