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

Setting Properties of User Control On Master Page

Hi All,

I have a user control on my master page, which exposes 3 public
properties (all boolean). Basically by the values of these properties,
the user control builds a menu to for users to navigate through the website.

I am wondering, how can I set the property of a usercontrol contained
within a Master Page, from a content page?

Kind Regards
Jul 24 '07 #1
3 5272
Usually by exposing them as Master page properties - as your user control is
"internal" to the master page, it makes sense to only manipulate them within
it.
"Mick Walker" wrote:
Hi All,

I have a user control on my master page, which exposes 3 public
properties (all boolean). Basically by the values of these properties,
the user control builds a menu to for users to navigate through the website.

I am wondering, how can I set the property of a usercontrol contained
within a Master Page, from a content page?

Kind Regards
Jul 24 '07 #2
Could you please give me an example of how to achieve this please?

Sergey Poberezovskiy wrote:
Usually by exposing them as Master page properties - as your user control is
"internal" to the master page, it makes sense to only manipulate them within
it.
"Mick Walker" wrote:
>Hi All,

I have a user control on my master page, which exposes 3 public
properties (all boolean). Basically by the values of these properties,
the user control builds a menu to for users to navigate through the website.

I am wondering, how can I set the property of a usercontrol contained
within a Master Page, from a content page?

Kind Regards
Jul 24 '07 #3
--master.master--
<asp:Label ID="lblWelcomeMessage" runat="server" />

--master.master.cs--
public string WelcomeMessage
{
get { return lblWelcomeMessage.Text; }
set { lblWelcomeMessage.Text = value; }
}

--page.aspx.cs--
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.Master.WelcomeMessage = "Hello World!";
}
"Mick Walker" <Mi*********@privacy.netwrote in message
news:5g*************@mid.individual.net...
Could you please give me an example of how to achieve this please?

Sergey Poberezovskiy wrote:
>Usually by exposing them as Master page properties - as your user control
is "internal" to the master page, it makes sense to only manipulate them
within it.
"Mick Walker" wrote:
>>Hi All,

I have a user control on my master page, which exposes 3 public
properties (all boolean). Basically by the values of these properties,
the user control builds a menu to for users to navigate through the
website.

I am wondering, how can I set the property of a usercontrol contained
within a Master Page, from a content page?

Kind Regards
Jul 24 '07 #4

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

Similar topics

4
by: rmccinc | last post by:
Hello- I am missing something very easy here I think. I have 3 files test.master.vb (Master) content.aspx.vb (content) Control.ascx.vb (user Control)
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
3
by: Joel Reinford | last post by:
I am attempting to learn how to use Master Pages in ASP.NET 2.0 and am having no success in getting the content page to see the public properties in the master page. I am using code beside and have...
0
by: Paul | last post by:
Hello, and Good Morning, I need to Cross-page post some values to the target page. Since I am using Master pages and User Controls, I am finding it hard to get the thing working, so I am...
5
by: Aussie Rules | last post by:
Hi, Within the code of a content page, how do you say set the .text value of a label thats on the master page.... Thanks
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
1
by: Asif | last post by:
Hi All, I did follow the MSDN article (http://msdn2.microsoft.com/en-us/ library/ms379585(VS.80).aspx ) for overriding Master Page properties by setting page title and other Meta information(...
3
by: William Youngman | last post by:
I am on a team that is developing a proposal generation web application and we are using a custom base page (ProGenBase.cs) located in the app_code directory and all of the app's web pages inherit...
4
by: evantay | last post by:
I'm using ASP.NET 2.0 with VS.NET 2005. I'm trying to access properties from my master pages within a page that inherits from that master page (a child page). However the values are always null....
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.