asp.net masterpage and mastertype

posted 5/7/2006 7:56:43 AM by: timothy

in asp.net 2.0, if you setup a masterpage and declare a public property in it to be consumed by the content page, you must use the mastertype directive in the aspx content page or your codebehind will complain on compile about a statement like:

Master.PublicProperty = "value";

The mastertype directive to put in the aspx content page looks like this:

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

© 1999—2019 Timothy Lee Russell

vcard

View Timothy Russell's profile on LinkedIn

profile for Timothy Lee Russell at Stack Overflow, Q&A for professional and enthusiast programmers