473,396 Members | 2,013 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,396 software developers and data experts.

more than one field bind to hyperlink datatextfield

Is there a way to set hyperlink's datatextfield bind to more than one field

for ex:
<asp:HyperLinkColumn DataNavigateUrlField="CustomerID"
DataNavigateUrlFormatString="Customer.aspx?ID={0}"
DataTextField="CustomerID,CustomerType" DataTextFormatString="Customer:
{0} - Type: {1}"

It gave me error "A field or property with the name
'CustomerID,CustomerType' was not found on the selected datasource"
Nov 19 '05 #1
2 2362
No you can't, not that way.... But you can always in your SELECT Statement
put the two columns together so the Datasource returns one more Column that
is ready to bind with this information.

SELECT (CustomerID + ', ' + CustomerType) as 'Customertext' FROM ...

/Lars Netzel

"mimi" <mh****@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
Is there a way to set hyperlink's datatextfield bind to more than one
field

for ex:
<asp:HyperLinkColumn DataNavigateUrlField="CustomerID"
DataNavigateUrlFormatString="Customer.aspx?ID={0}"
DataTextField="CustomerID,CustomerType" DataTextFormatString="Customer:
{0} - Type: {1}"

It gave me error "A field or property with the name
'CustomerID,CustomerType' was not found on the selected datasource"

Nov 19 '05 #2
thanks. That is an easy solution

"Lars Netzel" <ui****@adf.se> wrote in message
news:uJ**************@TK2MSFTNGP09.phx.gbl...
No you can't, not that way.... But you can always in your SELECT Statement
put the two columns together so the Datasource returns one more Column that is ready to bind with this information.

SELECT (CustomerID + ', ' + CustomerType) as 'Customertext' FROM ...

/Lars Netzel

"mimi" <mh****@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP15.phx.gbl...
Is there a way to set hyperlink's datatextfield bind to more than one
field

for ex:
<asp:HyperLinkColumn DataNavigateUrlField="CustomerID"
DataNavigateUrlFormatString="Customer.aspx?ID={0}"
DataTextField="CustomerID,CustomerType" DataTextFormatString="Customer:
{0} - Type: {1}"

It gave me error "A field or property with the name
'CustomerID,CustomerType' was not found on the selected datasource"


Nov 19 '05 #3

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

Similar topics

4
by: Keith | last post by:
I have this simple scenario. -------- Choose an item ->dropdownlist-> or <a>Create a new item</a> -------- When someone decides to click on the create a new item link, it takes them to a...
4
by: Kurt Schroeder | last post by:
I have a data grid with about 20 repeating items. they data: colors, red colors,blue colors, green Animals cat animals bird people, Tom people, Bill people, Kris
0
by: Nick | last post by:
Hi, I have a Repeater control and want to bind a hyperlink to each repeated row. For this I can use the following syntax (excuse any incorrect naming but I don't have any code to hand): ...
4
by: Dabbler | last post by:
I have two tables I'm editing in a Gridview. The VANS table contains a key to the other LESSOR table. I would like to use a dropdown list to select the LessorId value while displaying the Lessor...
0
by: jdw | last post by:
I have seen sample code to add mailto feature in datagrid hyperlink field using the RowDataBound event. I did it a bit different. e-amil address are stored in a database. name@domain.com. I...
2
by: smccauslin | last post by:
URLs are stored in a database in a form similar to www.mysite.com. When the user clicks on the link, it should launch a seperate window and go to that site. Here's the code <asp:HyperLink...
0
by: Frank | last post by:
Hello All, I am working with VS.NET 2005 and I have an editable GridView whose HTML markup is shown below. In short, when the user clicks on the Edit button, one of the textboxes is replaced...
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=" &...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...
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,...

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.