By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Setting Properties of User Control On Master Page

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
--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 discussion thread is closed

Replies have been disabled for this discussion.