Property in Master Page

S

shapper

Hello,

I created a property in my master page and I want to expose a panel to
the page which uses this master:

Private _Center As Panel
Public Property Center() As Panel
Get
Return _Center
End Get
Set(ByVal value As Panel)
_Center = value
End Set
End Property

In my page I tried to do something like:

Master.Center.Visible = True

Center is not recnognized.

What am I doing wrong or missing?

Thanks,

Miguel
 
M

Mark Fitzpatrick

Miguel,
When you access Master inside a normal page, the Master is a generic
MasterPage. You have to specifically cast Master to the type of your
MasterPage. That will expose the custom properties available to the
masterpage you created.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top