473,397 Members | 2,116 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,397 software developers and data experts.

ASP.NET 2.0 Master Page public properties

I am attempting to learn how to use Master Pages in ASP.NET 2.0 and am
having no success in getting the content page to see the public properties
in the master page. I am using code beside and have tried both with and
without namespace references.

Can anyone give me any suggestions on what I need to do to make the master
page public properties accessible to the content page?

Joel Reinford
Data Management Solutions LLC
Dec 5 '05 #1
3 1434
There was some related master pages discussion just a few days ago, I
think that might give some hints:

http://groups.google.com/group/micro...25cf6b199007cb

Remy Blaettler
www.collaboral.com

Dec 5 '05 #2
Hey Joel,

The best way to understand the master pages is to assume that it is a kind
of user control. So if you try to access the variables in the master page
using page_load event of the other page (say, webform1.aspx), you will not be
successful in doing that.

What you need to do is to use, the page_init method in the webform1.aspx and
access the variables as...

Response.write(CType(Me.Master, MasterPage).VariableName)

HTH!

--
Thanks,
Rahul Soni

--->The secret to creativity is knowing how to hide your sources<---

"Joel Reinford" wrote:
I am attempting to learn how to use Master Pages in ASP.NET 2.0 and am
having no success in getting the content page to see the public properties
in the master page. I am using code beside and have tried both with and
without namespace references.

Can anyone give me any suggestions on what I need to do to make the master
page public properties accessible to the content page?

Joel Reinford
Data Management Solutions LLC

Dec 5 '05 #3
Thanks Remy

This thread got me headed in the right direction. The answer is to put an
@MasterType declaration in the content pages. It has this form:
<%@ MasterType VirtualPath="~/default.master" %>

Once that's been done, I can access the properties of the master page.

Joel Reinford
Data Management Solutions LLC

"Remy" <rb********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
There was some related master pages discussion just a few days ago, I
think that might give some hints:

http://groups.google.com/group/micro...25cf6b199007cb

Remy Blaettler
www.collaboral.com

Dec 5 '05 #4

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

Similar topics

2
by: Steve Franks | last post by:
I am trying to access strongly typed properties in a page's master page from the content page. I followed an article that describes how to do this, and it seems quite straight forward. However...
4
by: Steve Franks | last post by:
I have this cool nested master page scenario working great. However what is the correct way to be able to access a strongly typed property at the top level master from a content page that has a...
2
by: Mark Rae | last post by:
Hi, It's easy enough to get a content page to refer to public properties on its associated master page e.g. public partial class master_secure : System.Web.UI.MasterPage { public Label...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
4
by: Suresh | last post by:
Is there any way to access the custom properties of a master page from the aspx form? I know the custom properties of a master page can be accessed from the aspx.cs partial class by specifying...
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
0
by: dixonjm | last post by:
Hi, I have a master page & various pages that will use this master page. Each content page will have a CSS & JS file which will be named the same as the content page. When I try to load the CSS...
3
by: Mick Walker | last post by:
Hi All, I have a user control on my master page, which exposes 3 public properties (all boolean). Basically by the values of these properties, the user control builds a menu to for users to...
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.