Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > hiding linkbuttons on masterpage

Reply
Thread Tools

hiding linkbuttons on masterpage

 
 
JohnE
Guest
Posts: n/a
 
      01-05-2010
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
 
Reply With Quote
 
 
 
 
JohnE
Guest
Posts: n/a
 
      01-05-2010
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

 
Reply With Quote
 
 
 
 
Abdul Sami
Guest
Posts: n/a
 
      01-05-2010
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

 
Reply With Quote
 
JohnE
Guest
Posts: n/a
 
      01-05-2010
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

 
Reply With Quote
 
Abdul Sami
Guest
Posts: n/a
 
      01-06-2010
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing a control on a masterpage that uses a second masterpage Torben Laursen ASP .Net 4 03-15-2008 03:27 AM
Masterpage change its masterpage mr t ASP .Net 0 08-29-2007 10:11 PM
MasterPages - take plain form, add MasterPage. MasterPage does NOT appear when run Randy Smith ASP .Net 9 04-14-2007 09:06 AM
MasterPage inheriting a MasterPage... is it possible? ThunderMusic ASP .Net 2 09-27-2006 07:57 PM
MasterPage -> Page -> MasterPage Code Access =?Utf-8?B?QWxleCBNYWdoZW4=?= ASP .Net 3 04-14-2006 12:34 PM



Advertisments