MasterPage problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have set up public properties, methods and even classes inside my masterpage.

only when I go to my content page they are not visible. I try
master.<where is my property>
and even
asp.nameofmymasterpage.<no public property here>

on my content page I also have to directive
<%@ MasterType virtualPath="~/AtlasMaster.master"%>
nothing..nada.

I simply cant do what I have seen written in many examples.
why?
 
You have to cast it to the specific kind of Master Page in order to access
the custom properties you've created.
The generic MasterPage base class (which you're essentially referencing
currently) doesn't have your custom properties so you can't access them that
way.
Here are more details and code samples:
http://SteveOrr.net/faq/PassDataToMaster.aspx
 
Sean said:
I have set up public properties, methods and even classes inside my
masterpage.

only when I go to my content page they are not visible. I try
master.<where is my property>
and even
asp.nameofmymasterpage.<no public property here>

on my content page I also have to directive
<%@ MasterType virtualPath="~/AtlasMaster.master"%>
nothing..nada.

I simply cant do what I have seen written in many examples.
why?


You have to do the following (I haven't used the @MasterType directive, just
MasterPageFile= )

dim mp as yourMasterPageClassName = ctype(page.master,
yourMasterPageClassName)
mp.PropertyName = "PropertyValue"

Mike
 
Well I ended up closing visual studio, re-opening it and basically
intellisense was then picking it up.

The source of my problem (why I needed to get a property from the master) in
the first places ends up being because I am using Atlas update panels on a
login control and completely forgot that the login control was wrapped.

The intellisense not picking up may have something to do with Atlas but
either way I am taking out Atlas and then seeing if I can use it again only
after everything is finished.
 

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

Back
Top