modify visibility of master page controls from pages user control?

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFiYmxlcg==?=, Jul 27, 2006.

  1. 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 controls in the master page? How can I
    get the Master Page to re-render itself after I've done this?

    Thanks for any suggestions on this.

    Dabbler
     
    =?Utf-8?B?RGFiYmxlcg==?=, Jul 27, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?RGFiYmxlcg==?=

    Arthur Dent Guest

    I would put either a public method on the master page to wrap the
    hiding/showing logic, or wrap each hyperlink controls with
    Public ReadOnly Property MyLink1 As HyperLink
    get
    return myHyperLink1
    end get
    End Property

    then in the derived page there is a property (Me.MasterPage i think) which
    you can cast to the specific type of your master page.

    So with in the derived page you could do something like

    CType(Me.MasterPage, myMasterPageClass).MyLink1.Visible = (...some boolean
    expression...)

    If you have a base page class from which all your pages derive, you could
    wrap the MasterPage cast in a property on that base class,
    (this is only really simply feasible if you only use a single master page in
    your application)
    something like...

    Class BasePageClass
    ...
    Public ReadOnly Property MyMaster As myMasterPageClass
    Get
    Return DirectCast(Me.MasterPage, myMasterPageClass)
    End Get
    End Property
    ...
    End Class


    "Dabbler" <> wrote in message
    news:...
    >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 controls in the master page? How
    > can I
    > get the Master Page to re-render itself after I've done this?
    >
    > Thanks for any suggestions on this.
    >
    > Dabbler
     
    Arthur Dent, Jul 27, 2006
    #2
    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,467
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 11, 2005
  2. Replies:
    1
    Views:
    3,224
    PeterKellner
    May 16, 2006
  3. Sam
    Replies:
    0
    Views:
    706
  4. Sam
    Replies:
    1
    Views:
    785
  5. SerpentKiss2010
    Replies:
    0
    Views:
    2,497
    SerpentKiss2010
    Apr 6, 2011
Loading...

Share This Page