473,416 Members | 1,730 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,416 software developers and data experts.

asp:Hyperlink Question

I have the following hyperlink webcontrol. The problem is that I can't
figure out how to pass the webform's Request.Querystring("id") param into the
NavigateURL as shown below. As it is currently formatted the hyperlink
appears but I can't click on it. Could someone please let me know how to
format this correctly?

<asp:HyperLink id="hlBarcodes" style="Z-INDEX: 112; LEFT: 465px; POSITION:
absolute; TOP: 115px" runat="server" Text="Barcodes" NavigateURL='<%#
"Barcodes.aspx?id=" & Request.Querystring("id") %>' Target="_blank"
Name="HyperLink2" Width="72px" ForeColor="White" Font-Names="Verdana"
Font-Size="Larger"></asp:HyperLink>
Nov 19 '05 #1
3 1583
MrMike, is this hyperlink inside a repeater/datagrid/datalist? I ask
because the <%# is a databinding expression....

if it isn't, you need to use
hlBarCodes.NavigateUrl = "BarCodes.aspx?id=" & Request.QueryString("id")

in the page_load event (either in codebehind or not). If you don't want to
do this, simply use a normal link...

<a href="Barcodes.aspx?id=<%=Request.QueryString("id" )%>" target="..."
....>...</a> but that isn't very .net

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
I have the following hyperlink webcontrol. The problem is that I can't
figure out how to pass the webform's Request.Querystring("id") param into the NavigateURL as shown below. As it is currently formatted the hyperlink
appears but I can't click on it. Could someone please let me know how to
format this correctly?

<asp:HyperLink id="hlBarcodes" style="Z-INDEX: 112; LEFT: 465px; POSITION:
absolute; TOP: 115px" runat="server" Text="Barcodes" NavigateURL='<%#
"Barcodes.aspx?id=" & Request.Querystring("id") %>' Target="_blank"
Name="HyperLink2" Width="72px" ForeColor="White" Font-Names="Verdana"
Font-Size="Larger"></asp:HyperLink>

Nov 19 '05 #2
Well as Karl explained..u can use either of the 2 it depends how u want
the links rendered

hlBarCodes.NavigateUrl = "BarCodes.aspx?id=" & Request.QueryString("id")

<a href="barcodes.aspx?id=<%=request.querystring("id" )%>" target="..."
....>...</a>

Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #3
Thank you both!

"Patrick Olurotimi Ige" wrote:
Well as Karl explained..u can use either of the 2 it depends how u want
the links rendered

hlBarCodes.NavigateUrl = "BarCodes.aspx?id=" & Request.QueryString("id")

<a href="barcodes.aspx?id=<%=request.querystring("id" )%>" target="..."
....>...</a>

Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #4

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

Similar topics

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"...
4
by: James P. | last post by:
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...
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...
1
by: Joo Park | last post by:
How do you have a hyperlink that will open up a new window which passes in selected items from a listbox that is on the same page as the hyperlink using <asp:Hyperlink>? thx in advance!
2
by: MrMike | last post by:
I am attempting to pass a parameter named "BackURL" into a asp:Hyperlink HTML control as shown below. "BackURL" is actually a variable defined in the page's code-behind. However, my current...
9
by: Leon | last post by:
What Am I Doing Wrong? Code Will Not Run, I Can't See The Error! Thanks. <asp:datalist id="DataList1" runat="server" RepeatColumns="4"> <ItemTemplate> <asp:HyperLink id=HyperLink1 ImageUrl=...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.