473,394 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to set property of an asp:Hyperlink in a template from a user control.

Hello there,

I have an asp hyperlink in a template page. In my user control page -
code behind page that uses the template, I'd like to turn this link
invisible in certain case. Is it possible?

This is my hyperlink:
<asp:HyperLink id="hplShoppingCart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.aspx?fn=c">Shopping
Cart</asp:HyperLink>

Thanks in advance,
James
Nov 18 '05 #1
4 4372
Hi,

do you mean Master pages (ASP.NET 2.0) ?

this.Master.Findcontrol("hplShoppingCart").Visible = false;

if not what exactly you mean by Template form ?

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
TJS
you can wrap it in a panel tag and set visibility of the panel when
condition is correct

<asp:panel id="pnl1" visible="False" runat="server">
<asp:HyperLink id="hplShoppingCart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.aspx?fn=c">Shopping
Cart</asp:HyperLink>
</asp:panel>

"James P." <ha*********@yahoo.com> wrote in message
news:f4**************************@posting.google.c om...
Hello there,

I have an asp hyperlink in a template page. In my user control page -
code behind page that uses the template, I'd like to turn this link
invisible in certain case. Is it possible?

This is my hyperlink:
<asp:HyperLink id="hplShoppingCart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.aspx?fn=c">Shopping
Cart</asp:HyperLink>

Thanks in advance,
James

Nov 18 '05 #3
Natty Gur <na***@dao2com.com> wrote in message news:<OM**************@tk2msftngp13.phx.gbl>...
Hi,

do you mean Master pages (ASP.NET 2.0) ?

this.Master.Findcontrol("hplShoppingCart").Visible = false;

if not what exactly you mean by Template form ?

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


Thanks a lot, Natty. It's exactly what I need.
Nov 18 '05 #4
"TJS" <no****@here.com> wrote in message news:<ur**************@TK2MSFTNGP09.phx.gbl>...
you can wrap it in a panel tag and set visibility of the panel when
condition is correct

<asp:panel id="pnl1" visible="False" runat="server">
<asp:HyperLink id="hplShoppingCart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.aspx?fn=c">Shopping
Cart</asp:HyperLink>
</asp:panel>

"James P." <ha*********@yahoo.com> wrote in message
news:f4**************************@posting.google.c om...
Hello there,

I have an asp hyperlink in a template page. In my user control page -
code behind page that uses the template, I'd like to turn this link
invisible in certain case. Is it possible?

This is my hyperlink:
<asp:HyperLink id="hplShoppingCart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.aspx?fn=c">Shopping
Cart</asp:HyperLink>

Thanks in advance,
James


Thanks TJS. I like your solution.
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dustin II. | last post by:
Hi, I have an ASP.NET solution, and the ASPX page I have a form , I want to copy some of the data from that form to the clipboard, I am using the below script the script works fine when I use a...
0
by: Kevin Quigley | last post by:
Hi, I have a datalist which has an EditItemTemplate section, within this I have a hyperlink control with which I want to open a new window with some help details. This is the hyperlink code:...
2
by: Doug Stiers | last post by:
I have an asp:hyperlink that I need to have some code fire when the link is clicked. The link is in a datagrid and the link is working properly. I tried using the OnInit event to call the...
4
by: Amir Eshterayeh | last post by:
Dear Friends My asp hyperlink goes to relative address instead of absolute. I like navigate url goes to outsite link like www.asp.net but now, it goes to www.mysite/www.asp.net please help....
4
by: Brian W | last post by:
Hi All, I know this is a dumb question, but I'll ask it anyway... How do you do client-side scripting with an ASP control? For example I have: <asp:hyperlink id="Hyperlink1"...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
9
by: dana lees | last post by:
Hello, I am using asp:HyperLink in a c# asp.net application to open a new window in the following way: <asp:HyperLink ID="lnkSiteName" runat="server" Text='<%# DataBinder.Eval(Container,...
1
by: illmagination | last post by:
Hi, I need to display a small pop up message warning the user is leaving the website. At the same time I need to also keep track of who is leaving the website. My problem is that I can't user...
1
by: rsandes1 | last post by:
Newbie here, I'm trying to code a asp hyperlink control in C#, that has some literal string text concantenated with a programatic date field that changes as a certain conditions changes within my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.