473,399 Members | 2,478 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,399 software developers and data experts.

Master Page w/User controls

I initially created a master page for a common look and feel in my project. I
am trying to refer to a user control that is on a master page. When I add a
new web form to the project I check the checkbox for "Select master page" so
the page has the same look and feel as the master page. The problem comes in
when I want to refer to the user controls on the master page when I'm in the
web form. I can't seem to figure out how to do this. Does anybody know how to
refer to user controls on a master page while in a web form (that uses the
master page methodology)?

--
Chris Davoli

Oct 2 '06 #1
2 1383
The master page's controls aren't directly accessible because it's
members are protected. However, you can use the
Page.FindControl(string) method to locate specific controls on the
master page.

http://msdn2.microsoft.com/en-us/library/31hxzsdw.aspx

Chris Davoli wrote:
I initially created a master page for a common look and feel in my project. I
am trying to refer to a user control that is on a master page. When I add a
new web form to the project I check the checkbox for "Select master page" so
the page has the same look and feel as the master page. The problem comes in
when I want to refer to the user controls on the master page when I'm in the
web form. I can't seem to figure out how to do this. Does anybody know how to
refer to user controls on a master page while in a web form (that uses the
master page methodology)?

--
Chris Davoli
Oct 2 '06 #2
the bes appraoch is to have the master page implement an interface for
accessing its public properties. then you just cast Page.Master to the
interface.

-- bruce (sqlwork.com)

"Chris Davoli" <Ch*********@discussions.microsoft.comwrote in message
news:36**********************************@microsof t.com...
>I initially created a master page for a common look and feel in my project.
I
am trying to refer to a user control that is on a master page. When I add
a
new web form to the project I check the checkbox for "Select master page"
so
the page has the same look and feel as the master page. The problem comes
in
when I want to refer to the user controls on the master page when I'm in
the
web form. I can't seem to figure out how to do this. Does anybody know how
to
refer to user controls on a master page while in a web form (that uses the
master page methodology)?

--
Chris Davoli

Oct 2 '06 #3

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

Similar topics

5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
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...
20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
2
by: Scott | last post by:
I'm using a master page (mp_TableMaint.aspx) with one Content area (ID: Content1). Content1 contains several usercontrols, which are hidden. The goal is to show the correct control based on the...
1
by: Dabbler | last post by:
I have some hyperlink controls on a master page I need to disable till my user has made some selections in a user control on a page based on the master page. How do I reference the Hyperlink...
1
by: | last post by:
Hey all! I'm new to 2.0. I use user controls, and since 99% of browsers have css now, I use absolute positioning to place my user controls.(Top banners, menus on the left side etc). In my case,...
0
by: Daniel Magliola | last post by:
I'm having a weird behaviour when implementing localization resource files in my website. This looks like a .Net bug to me, but it's too obvious to be there, so I must be overlooking something. ...
0
by: robgallen | last post by:
I have 2 user controls within a master page, and I would like one of them to call a function in the other. All the examples I have seen involve a page communicating with the Master page, or with...
3
by: Cirene | last post by:
When you set the value of a user control in a master page, do you have to reference it differently? Also, do they have to be given different names in the templates? For example, this is what I...
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
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
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
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...

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.