469,927 Members | 1,983 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Access Master Pages from Ascx directly

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

May 2 '06 #1
1 3716
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

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

May 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Nils Magnus Englund | last post: by
5 posts views Thread by Nalaka | last post: by
9 posts views Thread by Andy | last post: by
17 posts views Thread by Rob R. Ainscough | last post: by
1 post views Thread by Rob R. Ainscough | last post: by
4 posts views Thread by Diane Yocom | last post: by
7 posts views Thread by TheLongshot | last post: by
3 posts views Thread by Adi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.