473,670 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Field Value as Hyperlink Name

I want to use the contents of one field to be the text the user clicks on
for a hyperlink in a datagrid. I am trying the following code but it does
not work. What is the correct syntax for this? The field "InfoURL" contains
the hyperlink and the field "City" is a string field containing the text I
want the user to be able to clock on.

<columns>
<asp:BoundColum n HeaderText="Sta rt Date" DataField="Star tDate"
DataFormatStrin g="{0:d}" />
<asp:BoundColum n HeaderText="Max <br>Perc<br>Uni ts" DataField="MaxL oc" />
<asp:HyperlinkC olumn
HeaderText="Inf o URL"
DataNavigateURL Field="InfoURL"
Text=<%# Container.DataI tem("City") %>.ToString />
</columns>

Wayne
Nov 18 '05 #1
1 2570
try using a template column like this

<asp:TemplateCo lumn>
<ItemTemplate >
<P align="center">
<asp:HyperLin k NavigateUrl='<% #
"CA_ShowProduct Stock.aspx?Prod uctID=" +
DataBinder.Eval (Container.Data Item,"ProductID ") + "&ProductColorI D=" +
DataBinder.Eval (Container.Data Item,"ProductCo lorID") %>' runat="server"
ID="Hyperlink2" >Size<br>&<br > Stock</asp:HyperLink>
</P>
</ItemTemplate>
</asp:TemplateCol umn>

--
Regards,
HD
Once a Geek.... Always a Geek
"Wayne Wengert" <wa************ ***@wengert.com > wrote in message
news:Og******** ******@TK2MSFTN GP12.phx.gbl...
I want to use the contents of one field to be the text the user clicks on
for a hyperlink in a datagrid. I am trying the following code but it does
not work. What is the correct syntax for this? The field "InfoURL"
contains
the hyperlink and the field "City" is a string field containing the text I
want the user to be able to clock on.

<columns>
<asp:BoundColum n HeaderText="Sta rt Date" DataField="Star tDate"
DataFormatStrin g="{0:d}" />
<asp:BoundColum n HeaderText="Max <br>Perc<br>Uni ts" DataField="MaxL oc"
/>
<asp:HyperlinkC olumn
HeaderText="Inf o URL"
DataNavigateURL Field="InfoURL"
Text=<%# Container.DataI tem("City") %>.ToString />
</columns>

Wayne

Nov 18 '05 #2

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

Similar topics

5
2967
by: Rob | last post by:
Help me, I'm just beginning with programming in Access 2000. I've tried the http://www.mvps.org/access/api/api0001.htm but it won't work in Access. What am i doing wrong. I don't have problems with the http://www.mvps.org/access/api/api0002.htm but it only browse to folders.
0
466
by: Tim | last post by:
Access 97: I have a table with a hyperlink field that I display on a form. I can click on the form field and the hyperlink activates correctly. However, if I try to activate the hyperlink using VB code, the last hyperlink that was clicked is the only one that displays. Background: The database is for providing instruction documentation for shop-floor personnel in a manufacturing environment. The main purpose of the database is to provide...
1
7932
by: Tom | last post by:
I have a project database in which I use hyperlinks to call up various related supporting documents (e.g., proposals, contracts, reports, site photos, etc.). The documentes are in Word, Excel, PDF and JPG formats and are all stored in a documents subfolder on my computer. I use a form with several Hyperlink text boxes (one for each type of document) which are bound to a table that stores the hyperlinks. I want the text box to respond to...
3
11098
by: Ray | last post by:
I recently upgraded from Access 97 to Access 2003 and just enter some new data into table via an input form. The form has one hyperlink field to contain a file path. In Access 2003, it appears not to accept file path and adds some additional characters, i.e.,%20 between space of the file path. Can someone advise why it happens and if I can use the old method to store the file path. Thanks, Ray
18
18363
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on a remote update of tables and fields and can't find enough information on these things. Also, how do you index a field in code?
3
3046
by: shapper | last post by:
Hello, In my GridView I have a HyperLink Field where I set the DataNavigateUrlFormaString MyHyperLinkField.DataNavigateUrlFormatString = "~\RSS.ashx?Channel={0}&Culture=" & System.Threading.Thread.CurrentThread.CurrentCulture.ToString() I believe {0} retrieves the value of my datasource column with index 0.
3
2092
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to the original form to correct the input. This all works fine until I try to incorporate a javascript to display a popup calendar which posts the selected date back to a field on the form. This script works fine in itself, however if the page is...
1
3733
by: Wolfman | last post by:
Hi gang! I've been searching for a solution to this problem extensively but nothing really hits the mark. I have a descriptive popup page that contains a PayPal order button. The normal PayPal form fields allow for the item description, fee, etc. I'd like the fee field to be variable based upon which hyperlink launched the popup. So, HREF click sets a variable INPUT TYPE (hidden) named "amount" equals the variable
1
1916
by: John | last post by:
Hi I have a grid view bound to an SqlDataSource. One of the fields in grid view is a hyperlink field. How can I set the hyperlink field's navigationurl to the value of a field coming form the underlying SqlDataSource? Thanks Regards
0
8471
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8388
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
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
8817
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
8593
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
8663
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...
0
4215
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
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.