473,788 Members | 3,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:HyperLin k id="hplShopping Cart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.as px?fn=c">Shoppi ng
Cart</asp:HyperLink>

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

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

this.Master.Fin dcontrol("hplSh oppingCart").Vi sible = 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:HyperLin k id="hplShopping Cart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.as px?fn=c">Shoppi ng
Cart</asp:HyperLink>
</asp:panel>

"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
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:HyperLin k id="hplShopping Cart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.as px?fn=c">Shoppi ng
Cart</asp:HyperLink>

Thanks in advance,
James

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

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

this.Master.Fin dcontrol("hplSh oppingCart").Vi sible = 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.co m> wrote in message news:<ur******* *******@TK2MSFT NGP09.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:HyperLin k id="hplShopping Cart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.as px?fn=c">Shoppi ng
Cart</asp:HyperLink>
</asp:panel>

"James P." <ha*********@ya hoo.com> wrote in message
news:f4******** *************** ***@posting.goo gle.com...
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:HyperLin k id="hplShopping Cart" runat="server" Font-Size="Larger"
Font-Names="Arial" NavigateUrl="../forms/ProductOrder.as px?fn=c">Shoppi ng
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
6210
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 normal anchor tag with the onclick event, but I want to be able to use an actual asp control like the hylperlink or linkbutton. I have tried the link button but it gives an error saying Compiler Error Message: BC30456: 'VBScript' is not a member of...
0
1272
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: <asp:HyperLink Runat="server" NavigateUrl="Help.htm"></asp:HyperLink> The problem is that when the link is clicked, nothing happens.
2
7981
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 subroutine but that fires when the control is rendered. I need the code to fire only when the users clicks on one of the links in the datagrid. Any help would be appreciated, Doug
4
8955
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. I create the navigatURL from database dynamically. I see the same question mentioned here but the response is not souitable for me: http://www.dotnet247.com/247reference/msgs/11/57708.aspx
4
2326
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" runat="server" NavigateUrl="~/" onclick="return false;">Home</asp:hyperlink>
5
6690
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 but here is the snippet of my asp:hyperlink object; <asp:HyperLink NavigateUrl="authonly/clientdetails.aspx?searchID="+<%#DataBinder.Eval(Conta iner.DataItem,"CLIENTREF")%> ID="Hyperlink1"><%#DataBinder.Eval(Container.DataItem,...
9
28050
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, "DataItem.name") %>' NavigateUrl='<%# "site.aspx?id=" + DataBinder.Eval (Container.DataItem,"id").ToString()%>' Target="_blank"> </asp:HyperLink>
1
2182
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 javascript in asp:hyperlink tags. Should I just use a regular <atag and include the IDs and Runat=Server tags? Here is my code
1
1138
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 applciation. The hyperlinks are used to select reports based on report dates that are dynamically changed as the report dates change. So I would like the text in the hyperlink stay the same with the exception of the report date in the...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.