Setting Properties of User Control On Master Page

Discussion in 'ASP .Net' started by Mick Walker, Jul 24, 2007.

  1. Mick Walker

    Mick Walker Guest

    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
    Mick Walker, Jul 24, 2007
    #1
    1. Advertising

  2. 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
    >
    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=, Jul 24, 2007
    #2
    1. Advertising

  3. Mick Walker

    Mick Walker Guest

    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
    >>
    Mick Walker, Jul 24, 2007
    #3
  4. Mick Walker

    Brandon Gano Guest

    --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" <> wrote in message
    news:...
    > 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
    >>>
    Brandon Gano, Jul 24, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug McCann
    Replies:
    1
    Views:
    993
    William Brogden
    Aug 5, 2004
  2. Laith Zraikat
    Replies:
    3
    Views:
    1,199
    Walter Wang [MSFT]
    Jul 6, 2006
  3. Aussie Rules
    Replies:
    5
    Views:
    5,247
    Walter Wang [MSFT]
    Jul 25, 2006
  4. William Youngman
    Replies:
    3
    Views:
    688
    William Youngman
    Apr 2, 2007
  5. Nathan Sokalski
    Replies:
    25
    Views:
    1,410
    Nathan Sokalski
    Mar 4, 2010
Loading...

Share This Page