Master Page w/User controls

Discussion in 'ASP .Net' started by =?Utf-8?B?Q2hyaXMgRGF2b2xp?=, Oct 2, 2006.

  1. 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
     
    =?Utf-8?B?Q2hyaXMgRGF2b2xp?=, Oct 2, 2006
    #1
    1. Advertising

  2. 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
     
    Chris Fulstow, Oct 2, 2006
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    >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
    >
     
    bruce barker \(sqlwork.com\), Oct 2, 2006
    #3
    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. Electrified Research
    Replies:
    5
    Views:
    2,502
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 11, 2005
  2. Doug McCann
    Replies:
    1
    Views:
    1,136
    William Brogden
    Aug 5, 2004
  3. Zeba
    Replies:
    1
    Views:
    541
    Mark Rae
    Feb 22, 2007
  4. Dinu
    Replies:
    1
    Views:
    667
    Masudur
    Jul 31, 2007
  5. SerpentKiss2010
    Replies:
    0
    Views:
    2,546
    SerpentKiss2010
    Apr 6, 2011
Loading...

Share This Page