Access Master Pages from Ascx directly

  • Thread starter Thread starter xs
  • Start date Start date
X

xs

Hi,

Is it possible to access Master Pages from Ascx directly? In an Aspx, by
entering the following ,
<%@ MasterType VirtualPath="~/Pages/Master.Master"%> , I can easily access
its property using this.Master.
But can I do that using Ascx controls? What can I do to access it directly?

Thanks
 
User controls have access to the page and from that you can access the master
via Page.Master. You won't have right type, but if your Master implements
a common interface or dervies from a common base class then you can always
downcast it.

-Brock
http://staff.develop.com/ballen
 
Back
Top