Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

cannot find property on master page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dwight Johnson - 04 Dec 2007 15:06 GMT
Following the directions found here ( http://msdn2.microsoft.com/en-us/ehszf8ax(VS.80).aspx
),
I have this public property on my master page:

   public string PropertyID { get { return propertyID; } }

On the content page I am trying to reference it:

   propertyID = Master.PropertyID;

When I compile I get this error: Master.Page does not contain
definition for 'PropertyID'.

The content page seems to be referencing the master page properly:  <
%@ Page Language="C#" MasterPageFile="~/MasterPage_XLS01.master" ...

What am I doing wrong?
Mark Rae [MVP] - 04 Dec 2007 15:18 GMT
> What am I doing wrong?

Sounds like you've forgotten to add the MasterType directive...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Dwight Johnson - 04 Dec 2007 15:57 GMT
Ah, yes, the MasterType directive, obviously required by the
Department of Redundancies Department. It sure looks redundant to have
the @Page directive with the MasterPageFile attribute followed
immediately by the @MasterType directive with the identical value in
the virtualpath attribute. I suppose there must be times where these
two directives would provide non-redundant information to the page.
Right? Or am I being overly optimistic?

Thanks for the info. That did fix the problem.
Mark Rae [MVP] - 04 Dec 2007 16:07 GMT
> the virtualpath attribute. I suppose there must be times where these
> two directives would provide non-redundant information to the page.
> Right?

Yes - nested MasterPages for one, and also you can specify the TypeName tag
rather than the VirtualPath tag for more flexibility...

> Or am I being overly optimistic?

Yes.

> Thanks for the info. That did fix the problem.

Well that's the main thing...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

David Wier - 04 Dec 2007 15:55 GMT
In case you don't know about the MasterType directive - check out:
http://odetocode.com/Blogs/scott/archive/2005/07/16/1944.aspx

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup

> Following the directions found here (
> http://msdn2.microsoft.com/en-us/ehszf8ax(VS.80).aspx
[quoted text clipped - 14 lines]
>
> What am I doing wrong?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.