473,394 Members | 1,773 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,394 software developers and data experts.

Referencing Master Page from a Web Control

PJ
I am trying to get reference to a Master page from a web user control.
However, I cannot seem to even access the type. I have been referencing the
master page in forms by declaring the master attribute atop the .aspx page.
This works fine, but this attribute is not recognized in controls.

Thanks
~PJ
Jan 3 '06 #1
3 1714
Try using Page.Master as your reference to the Master page, as long as the
MasterType directive is in your ASPX file. I haven't tried myself, but it
seems logical.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"PJ" <pj***@hotmail.com> wrote in message
news:iJ********************@speakeasy.net...
I am trying to get reference to a Master page from a web user control.
However, I cannot seem to even access the type. I have been referencing
the master page in forms by declaring the master attribute atop the .aspx
page. This works fine, but this attribute is not recognized in controls.

Thanks
~PJ

Jan 3 '06 #2
PJ
Yes, but then I would have to cast it. And again, for some reason I can't
even reference the type.

"Christopher Reed" <ca****@nospam.nospam> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Try using Page.Master as your reference to the Master page, as long as the
MasterType directive is in your ASPX file. I haven't tried myself, but it
seems logical.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"PJ" <pj***@hotmail.com> wrote in message
news:iJ********************@speakeasy.net...
I am trying to get reference to a Master page from a web user control.
However, I cannot seem to even access the type. I have been referencing
the master page in forms by declaring the master attribute atop the .aspx
page. This works fine, but this attribute is not recognized in controls.

Thanks
~PJ


Jan 3 '06 #3
You might try using a common namespace for everything (Master page, page,
user control) and see if this helps.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"PJ" <pj******@hotmail.com> wrote in message
news:lb******************************@speakeasy.ne t...
Yes, but then I would have to cast it. And again, for some reason I can't
even reference the type.

"Christopher Reed" <ca****@nospam.nospam> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Try using Page.Master as your reference to the Master page, as long as
the
MasterType directive is in your ASPX file. I haven't tried myself, but
it
seems logical.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"PJ" <pj***@hotmail.com> wrote in message
news:iJ********************@speakeasy.net...
>I am trying to get reference to a Master page from a web user control.
>However, I cannot seem to even access the type. I have been referencing
>the master page in forms by declaring the master attribute atop the
>.aspx
>page. This works fine, but this attribute is not recognized in controls.
>
> Thanks
> ~PJ
>



Jan 4 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property...
2
by: Mark Rae | last post by:
Hi, It's easy enough to get a content page to refer to public properties on its associated master page e.g. public partial class master_secure : System.Web.UI.MasterPage { public Label...
2
by: Alex Maghen | last post by:
I want to create a utility function that will seach the current page for one of my UserControls by it's type. So, let's say that I have a UserControl whose class I defined as follows: namespace...
4
by: Ned Balzer | last post by:
Can anyone explain why in the following code, where btnCancel1 is a Button inside the itemTemplate of the formview, the first call to change the text of the button, in the Page_Load sub, works...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
3
by: ASP Developer | last post by:
I would like to use a master page in my web application. All of my stylesheets and graphics are in folders one level above my web application. How do I go about referencing these files from pages...
3
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
How do i reference a control in the following scenario? Master page has an ascx file which show the total items and value in a shopping cart (using Profile data) This needs to be updated when...
0
by: jgdean14 | last post by:
Hi - We have an Early .NET 2.0 App that was created without Master Pages about a year ago. We opted for more of a MVC framework and dynamically- loaded User Controls. We use Custom User-Controls...
2
by: Bobby Edward | last post by:
I have a subdirectory with an aspx page that references a master file located in the root. In the master file template I reference a logo/image that is in <root>/resources... <img alt="logo"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.