1. How to access properties and controls in the master page from
content page?
To access properties you use the Page.Master property. Page.Master returns
the Master Page as a MasterPage object. To access the members of your
inherited MasterPage you need to cast it to the proper type. You can do so
by adding a MasterType directive to the top of your content page.
<%@ MasterType virtualpath="~/Main.master" %>
2. How to specify default content in the master page? (I've tried to
write something directly in the "ContentPlaceHolder" of the master
page. But I can't see it through running the content page, why?)
By default Content Pages automatically define custom content for the
Content sections. If you want it to use the default content then you can
right-click on the Content Panel and select "Default to Master's Content"
--
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com
"lichaoir" <li******@gmail.comwrote in message
news:11**********************@z24g2000prh.googlegr oups.com...
>I have two questions about the use of Master Page:
1. How to access properties and controls in the master page from
content page? (I know I can use the "FindControl()" method of the
"Master" Property to access the controls. But how can I access the
properties? I've tried to write a property in the master page and
access it from content page, but it didn't work.)
2. How to specify default content in the master page? (I've tried to
write something directly in the "ContentPlaceHolder" of the master
page. But I can't see it through running the content page, why?)
Thanks for your answer and discussion!