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

Master Pages - public properties


Hello I am having trouble accessing a public porperty that my master page
exposes
I try to access it in a content page but the property is not visible through
intell sense.

Master Page
'''''''''''''''''''''''''''''''''''''

string m_PageHeadingTitle = "My Company";

public string PageHeadingTitle
{
get
{
return m_PageHeadingTitle;
}
set
{
m_PageHeadingTitle = value;
}
}

'''''''''''''''''''''''''''''''
Conent Page

Master.PageHeadingTitle = "Test Page title";

--
Life in the sun
May 12 '06 #1
7 4020
Hi,

Thank you for posting!

You need to use the MasterType directive in your content page to create a
strongly typed reference to the ASP.NET master page when the master page is
accessed from the Master property. Here's a sample usage:

<%@ MasterType VirtualPath="~/MasterPage.master" %>

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #2
Thanks Walter
I get a error when trying to introduce this directive

<%@ Page Language="C#" MasterType VirtualPath="~/MasterPage.master"
MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Content01.aspx.cs" Inherits="Content01" Title="Untitled Page"
Theme="Summer" %>
"Master type is not a valid attribute of element page"


--
Life in the sun
"Walter Wang [MSFT]" wrote:
Hi,

Thank you for posting!

You need to use the MasterType directive in your content page to create a
strongly typed reference to the ASP.NET master page when the master page is
accessed from the Master property. Here's a sample usage:

<%@ MasterType VirtualPath="~/MasterPage.master" %>

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #3

Hi,

This is a directive just like the Page directive, so you need to put it in
a separate <%@ %> pair:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true"
CodeFile="Content01.aspx.cs" Inherits="Content01" Title="Untitled Page"
Theme="Summer" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>

If there is anything unclear, please feel free to post here.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #4
Walter,
You are the man , in now works thanks
--
Life in the sun
"Walter Wang [MSFT]" wrote:

Hi,

This is a directive just like the Page directive, so you need to put it in
a separate <%@ %> pair:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true"
CodeFile="Content01.aspx.cs" Inherits="Content01" Title="Untitled Page"
Theme="Summer" %>
<%@ MasterType VirtualPath="~/MasterPage.master" %>

If there is anything unclear, please feel free to post here.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #5
Hi,

Appreciate your update and response. I am glad to hear that the problem has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!
Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #6
Gee I hope this guy WayDownUnder you misled comes back to read these
comments Walter. Why didn't you tell him he didn't need to write properties
to access the Page title?

// In Page_Load this is all that is needed...
Page.Title = "Whatever";

There's also some clever developers who have documented how to use the
SiteMap file as the meta data for the Page.Title property which is already
public.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Walter Wang [MSFT]" <wa****@online.microsoft.com> wrote in message
news:Os****************@TK2MSFTNGXA01.phx.gbl...
Hi,

Appreciate your update and response. I am glad to hear that the problem
has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!
Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

May 12 '06 #7
ClintonG,
The post was a wee bit misleading. It wasnt the page title I was really
interested in ,
I just used that as an example. It was accessing public properties in
general that I wanted to know about.
Thanks

--
Life in the sun
"clintonG" wrote:
Gee I hope this guy WayDownUnder you misled comes back to read these
comments Walter. Why didn't you tell him he didn't need to write properties
to access the Page title?

// In Page_Load this is all that is needed...
Page.Title = "Whatever";

There's also some clever developers who have documented how to use the
SiteMap file as the meta data for the Page.Title property which is already
public.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"Walter Wang [MSFT]" <wa****@online.microsoft.com> wrote in message
news:Os****************@TK2MSFTNGXA01.phx.gbl...
Hi,

Appreciate your update and response. I am glad to hear that the problem
has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!
Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.


May 15 '06 #8

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...
3
by: Joel Reinford | last post by:
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...
1
by: Diane Yocom | last post by:
I have two nested master pages, each with public properties. From my content page, I am able to access properties from both pages using either Master.PropertyName (for the child master page) or...
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: 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....
2
by: Stratum | last post by:
It's an old question, and I apologize for raising it again. I use ImageButton objects on my ASP.Net master page to navigate to content pages. For each button, I have two images. One image shows...
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.