473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 3809
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nils Magnus Englund | last post by:
Hi! I'm playing around with Wilson's master pages for ASP.NET 1.1. It seems ok, but I'm really struggling with the following two problems: 1) I want all .aspx pages to inherit from the same...
14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
5
by: Nalaka | last post by:
Hi, When an image is put on a master page... the url to th eimage is set relatve to the master page. (at least don't know how top set an absolute URL to image) But the when a content page is...
9
by: Andy | last post by:
Hey all, I'm building out my first project using asp.net v2.0 master pages. It seems that when you use master pages and try to reference document.body.scrollTop it allways = zero/0. The same code...
17
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
1
by: Rob R. Ainscough | last post by:
I'm running into a problem with Master Pages. I have some "absolute" controls (labels, textboxes) that I position on the page using: ControlObject.Style.Add("Top", "250") or ...
4
by: Diane Yocom | last post by:
I'm trying to use an Atlas UpdatePanel to just update a label when a text box has changed. The problem is that my textbox is in a user control and I'm using Master Pages - with the combination of...
7
by: TheLongshot | last post by:
I just recently converted a few pages of my application to using master pages. Problem is, in all of my content pages, the contents are centered. I can't figure out why. The markup in the...
3
by: Adi | last post by:
Hi all, I have a menu which is placed in the master page. Now when the user clicks on one of the menu item, it fires an event which is handled in the master page. I need to know from which page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.