473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

MasterPage problem

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?
Jun 11 '06 #1
3 2599
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

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Sean" <Se**@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
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?

Jun 11 '06 #2

"Sean" <Se**@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
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
Jun 11 '06 #3
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.

"Steve C. Orr [MVP, MCSD]" wrote:
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

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Sean" <Se**@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
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?


Jun 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Leffe Andersson | last post by:
Hi folks! I have a MasterPage with some public methods, and I would like to call them from a (app_code) class. Is it possible to set a directive or an assembly reference to a MasterPage from a...
0
by: Herman verschooten | last post by:
Hi, I am creating my first real ASP.NET 2.0 site and want to use the some of the new features. I created a masterpage with my main layout and added several contentpages, no problem so far. I...
2
by: dawg1998 | last post by:
I am trying to access a label located in a MasterPage from a class located in my application's App_Code folder. The problem seems to be that the class cannot communicate with the MasterPage due to...
2
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. This process worked great when the page was standalone. However, when I move to a...
6
by: Mirek Endys | last post by:
HEEELP!!!! I have a big problem :))))) How to use url in CSS stylesheet file that is linked into MasterPage. The tilda '~' (as shortcut to the root of the webserver) is not working, and my...
3
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing,...
2
by: ThunderMusic | last post by:
Hi, Maybe there is another way of doing this, but here's my problem... I have my web site where I have a master page to have a common layout and a common behavior on all my pages (that's what...
3
by: Tor Inge Rislaa | last post by:
I have a MasterPage containing a TreeView menu. When clicking a menu item, a page is loaded into the ContentPlaceHolder. It seems like both the MasterPage and the page in the ContentPlaceHolder is...
4
by: Torben Laursen | last post by:
I want to change the label of a component that I have on a masterpage but I cannot get my hands on it I have a mastepage MP2 that has a button called B2 masterpage MP2 uses masterpage MP1 that has...
0
by: Tommy Jakobsen | last post by:
Hi. Is there a problem when trying to use Javascript on a nested masterpage? On my masterpage, i've got this in the <head>: <asp:ContentPlaceHolder ID="HeadContent" runat="server" /> And on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.