more than one field bind to hyperlink datatextfield

  • Thread starter Thread starter mimi
  • Start date Start date
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"
 
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
 
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
 
Back
Top