troubleshooting Question

Accessing a Usercontrol inside a masterpage from a page using the masterpage?

Avatar of ddivita
ddivita asked on
.NET ProgrammingASP.NETVisual Basic.NET
1 Comment1 Solution354 ViewsLast Modified:
I have a master page that has a usercotnrol on it. There is another page that uses the masterpage. On the masterpage i have a usercotnrol, let's say its id is header. I have my page using the <%@ MasterType VirtualPath="~/MasterPages/TheMasterPage.master"  %> directive.

I have tried creating a readonly property that returns the usercontrol, but I cannot access any of the usercontrols  public properties.  
Also, from the aspx page I cannot access the usercontrols namespace. I can from the master page an think it is because I have inhertited from the class? Anyway, here is an example of how my codebehinds look in pseudo code :
Namespace SS.Masterpages
Partial Class TheMasterPage
Public Readonly Property SSTheUserControl as SS.UserControls.TheUserControl&.
End Class
End Namespace

NameSpace SS.UserControls
      Public Class TheUserControl
      Public Property Property1 as string&.
      Public Property Property2 as string&.
      End Class
End NameSpace
The ASPX Page
NameSpace SS.Ppages
      Partial Class Index
      End Class
End NameSpace
So, what is the best way for me to access the userControl and any public properties? Thanks to all who look at this.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros