hiding linkbuttons on masterpage

Discussion in 'ASP .Net' started by JohnE, Jan 5, 2010.

  1. JohnE

    JohnE Guest

    I have a masterpage that has a row of linkbuttons on it. These linkbuttons
    open up the different applications that are being developed. The number of
    linkbuttons will continue to grow from the current 3 to at least 7 (possibly
    more). The webapps are using a nested master page inheriting from the master
    page which includes the css so the look and feel to the users is consistent.
    The website opens to a specific webapp (a type of message center) and the
    others can then be opened by using one of the linkbuttons. Each webapp opens
    in its own window (Target="_blank"). When the webapp does open, the row of
    linkbuttons show on the masterpage. The preference is to hide them when a
    webapp opens so the user is not able to use them. This would only be for the
    open webapp. Is there a way to hide the linkbuttons on the masterpage when
    the webapps are opened up from the linkbuttons?

    I have tried the following line but it does not seem to work, or I'm putting
    it in the wrong place.

    Page.Master.FindControl("hlnkProteus").Visible = false;

    Thanks for the help on this. May need some specifics on this as my asp.net
    is not that proficient.

    .... John
     
    JohnE, Jan 5, 2010
    #1
    1. Advertising

  2. JohnE

    JohnE Guest

    Let me revise. They are hyperlinks, not linkbuttons.
    Sorry about that.


    "JohnE" wrote:

    > I have a masterpage that has a row of linkbuttons on it. These linkbuttons
    > open up the different applications that are being developed. The number of
    > linkbuttons will continue to grow from the current 3 to at least 7 (possibly
    > more). The webapps are using a nested master page inheriting from the master
    > page which includes the css so the look and feel to the users is consistent.
    > The website opens to a specific webapp (a type of message center) and the
    > others can then be opened by using one of the linkbuttons. Each webapp opens
    > in its own window (Target="_blank"). When the webapp does open, the row of
    > linkbuttons show on the masterpage. The preference is to hide them when a
    > webapp opens so the user is not able to use them. This would only be for the
    > open webapp. Is there a way to hide the linkbuttons on the masterpage when
    > the webapps are opened up from the linkbuttons?
    >
    > I have tried the following line but it does not seem to work, or I'm putting
    > it in the wrong place.
    >
    > Page.Master.FindControl("hlnkProteus").Visible = false;
    >
    > Thanks for the help on this. May need some specifics on this as my asp.net
    > is not that proficient.
    >
    > ... John
     
    JohnE, Jan 5, 2010
    #2
    1. Advertising

  3. JohnE

    Abdul Sami Guest

    Try this

    in c#
    LinkButton lnkBtnActivate = (LinkButton)Master.FindControl("lnkBtnActivate");
    lnkBtnActivate.Visible = false;


    in vb it would be
    Dim lnkBtnActivate As LinkButton =
    DirectCast(Master.FindControl("lnkBtnActivate"), LinkButton)
    lnkBtnActivate.Visible = False


    --
    Abdul Sami


    "JohnE" wrote:

    > I have a masterpage that has a row of linkbuttons on it. These linkbuttons
    > open up the different applications that are being developed. The number of
    > linkbuttons will continue to grow from the current 3 to at least 7 (possibly
    > more). The webapps are using a nested master page inheriting from the master
    > page which includes the css so the look and feel to the users is consistent.
    > The website opens to a specific webapp (a type of message center) and the
    > others can then be opened by using one of the linkbuttons. Each webapp opens
    > in its own window (Target="_blank"). When the webapp does open, the row of
    > linkbuttons show on the masterpage. The preference is to hide them when a
    > webapp opens so the user is not able to use them. This would only be for the
    > open webapp. Is there a way to hide the linkbuttons on the masterpage when
    > the webapps are opened up from the linkbuttons?
    >
    > I have tried the following line but it does not seem to work, or I'm putting
    > it in the wrong place.
    >
    > Page.Master.FindControl("hlnkProteus").Visible = false;
    >
    > Thanks for the help on this. May need some specifics on this as my asp.net
    > is not that proficient.
    >
    > ... John
     
    Abdul Sami, Jan 5, 2010
    #3
  4. JohnE

    JohnE Guest

    They are actually hyperlinks rather then linkbuttons. Also, I would put this
    as code-behind but in the page load of the nested masterpage?

    .... John




    "Abdul Sami" wrote:

    > Try this
    >
    > in c#
    > LinkButton lnkBtnActivate = (LinkButton)Master.FindControl("lnkBtnActivate");
    > lnkBtnActivate.Visible = false;
    >
    >
    > in vb it would be
    > Dim lnkBtnActivate As LinkButton =
    > DirectCast(Master.FindControl("lnkBtnActivate"), LinkButton)
    > lnkBtnActivate.Visible = False
    >
    >
    > --
    > Abdul Sami
    >
    >
    > "JohnE" wrote:
    >
    > > I have a masterpage that has a row of linkbuttons on it. These linkbuttons
    > > open up the different applications that are being developed. The number of
    > > linkbuttons will continue to grow from the current 3 to at least 7 (possibly
    > > more). The webapps are using a nested master page inheriting from the master
    > > page which includes the css so the look and feel to the users is consistent.
    > > The website opens to a specific webapp (a type of message center) and the
    > > others can then be opened by using one of the linkbuttons. Each webapp opens
    > > in its own window (Target="_blank"). When the webapp does open, the row of
    > > linkbuttons show on the masterpage. The preference is to hide them when a
    > > webapp opens so the user is not able to use them. This would only be for the
    > > open webapp. Is there a way to hide the linkbuttons on the masterpage when
    > > the webapps are opened up from the linkbuttons?
    > >
    > > I have tried the following line but it does not seem to work, or I'm putting
    > > it in the wrong place.
    > >
    > > Page.Master.FindControl("hlnkProteus").Visible = false;
    > >
    > > Thanks for the help on this. May need some specifics on this as my asp.net
    > > is not that proficient.
    > >
    > > ... John
     
    JohnE, Jan 5, 2010
    #4
  5. JohnE

    Abdul Sami Guest

    I couldn't understand the problem exactly , but here are three things which
    you can do:

    1: to hide masterpage's masterpage control
    Master.Master.FindControl("HyperLink1").Visible = false;

    2: onclick of linkbutton let it open a new application and call a server
    side or javascript function to hide the linkbutton you want to hide for the
    current page

    3: you can call a javascript function of parent window from child window by
    window.opener.functionname()
    and from there you can show hide the things


    --
    Abdul Sami


    "JohnE" wrote:

    > They are actually hyperlinks rather then linkbuttons. Also, I would put this
    > as code-behind but in the page load of the nested masterpage?
    >
    > ... John
    >
    >
    >
    >
    > "Abdul Sami" wrote:
    >
    > > Try this
    > >
    > > in c#
    > > LinkButton lnkBtnActivate = (LinkButton)Master.FindControl("lnkBtnActivate");
    > > lnkBtnActivate.Visible = false;
    > >
    > >
    > > in vb it would be
    > > Dim lnkBtnActivate As LinkButton =
    > > DirectCast(Master.FindControl("lnkBtnActivate"), LinkButton)
    > > lnkBtnActivate.Visible = False
    > >
    > >
    > > --
    > > Abdul Sami
    > >
    > >
    > > "JohnE" wrote:
    > >
    > > > I have a masterpage that has a row of linkbuttons on it. These linkbuttons
    > > > open up the different applications that are being developed. The number of
    > > > linkbuttons will continue to grow from the current 3 to at least 7 (possibly
    > > > more). The webapps are using a nested master page inheriting from the master
    > > > page which includes the css so the look and feel to the users is consistent.
    > > > The website opens to a specific webapp (a type of message center) and the
    > > > others can then be opened by using one of the linkbuttons. Each webapp opens
    > > > in its own window (Target="_blank"). When the webapp does open, the row of
    > > > linkbuttons show on the masterpage. The preference is to hide them when a
    > > > webapp opens so the user is not able to use them. This would only be for the
    > > > open webapp. Is there a way to hide the linkbuttons on the masterpage when
    > > > the webapps are opened up from the linkbuttons?
    > > >
    > > > I have tried the following line but it does not seem to work, or I'm putting
    > > > it in the wrong place.
    > > >
    > > > Page.Master.FindControl("hlnkProteus").Visible = false;
    > > >
    > > > Thanks for the help on this. May need some specifics on this as my asp.net
    > > > is not that proficient.
    > > >
    > > > ... John
     
    Abdul Sami, Jan 6, 2010
    #5
    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. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    MasterPage -> Page -> MasterPage Code Access

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, Apr 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    7,922
    Steven Cheng[MSFT]
    Apr 14, 2006
  2. ThunderMusic
    Replies:
    2
    Views:
    463
    Gregory Gadow
    Sep 27, 2006
  3. Randy Smith
    Replies:
    9
    Views:
    450
    Mark Rae
    Apr 14, 2007
  4. mr t
    Replies:
    0
    Views:
    417
  5. Torben Laursen
    Replies:
    4
    Views:
    586
    clintonG
    Mar 15, 2008
Loading...

Share This Page