cannot find property on master page

D

Dwight Johnson

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?
 
D

Dwight Johnson

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.
 
M

Mark Rae [MVP]

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...
 

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

Top