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

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:BoundColumn HeaderText="Start Date" DataField="StartDate"
DataFormatString="{0:d}" />
<asp:BoundColumn HeaderText="Max<br>Perc<br>Units" DataField="MaxLoc" />
<asp:HyperlinkColumn
HeaderText="Info URL"
DataNavigateURLField="InfoURL"
Text=<%# Container.DataItem("City") %>.ToString />
</columns>

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

<asp:TemplateColumn>
<ItemTemplate>
<P align="center">
<asp:HyperLink NavigateUrl='<%#
"CA_ShowProductStock.aspx?ProductID=" +
DataBinder.Eval(Container.DataItem,"ProductID") + "&ProductColorID=" +
DataBinder.Eval(Container.DataItem,"ProductColorID ") %>' runat="server"
ID="Hyperlink2">Size<br>&<br> Stock</asp:HyperLink>
</P>
</ItemTemplate>
</asp:TemplateColumn>

--
Regards,
HD
Once a Geek.... Always a Geek
"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:Og**************@TK2MSFTNGP12.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:BoundColumn HeaderText="Start Date" DataField="StartDate"
DataFormatString="{0:d}" />
<asp:BoundColumn HeaderText="Max<br>Perc<br>Units" DataField="MaxLoc"
/>
<asp:HyperlinkColumn
HeaderText="Info URL"
DataNavigateURLField="InfoURL"
Text=<%# Container.DataItem("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
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...
0
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...
1
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...
3
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...
18
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...
3
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=" &...
3
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...
1
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...

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.