more than one field bind to hyperlink datatextfield

M

mimi

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"
 
L

Lars Netzel

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
 
M

mimi

thanks. That is an easy solution

Lars Netzel said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top