Custom properties in @Master directive

B

Bob

I created my own MasterPage class which inherits from
System.Web.UI.MasterPage and then added a public Organization string on it:

public partial class MyMasterPage : System.Web.UI.MasterPage
{
private String _organization;
public String Organization
{
get { return _organization; }
set { _organization = value; }
}
}

And then in my .master page I added the @Master directive:

<%@ Master
Language="C#"
CodeFile="mymasterpage.cs"
Inherits="MyMasterPage"
Organization="MyOrg" %>

However, this results in the following error:

Parser Error Message: Error parsing attribute 'oranization': Type
'System.Web.UI.MasterPage' does not have a public property named
'organization'.

When I remove 'Organizataion="MyOrg"' the page works. Does @Master support
custom public properties just like @Page does? If so, what am I doing
wrong?

Thanks
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top