My goal is to have multiple Hyperlinks in one single gridview's cell separated by comma, and the only way I could think of is to generate the HTML code when querying the data.
I have a simple query that will create number of Hyperlinks based on the match
SELECT A.TOLineKey,
STUFF((SELECT ',' + '<a href="XXX.com/soinformation.aspx?SONumber=' + CAST(SO3.SalesOrderNumber AS VARCHAR) + '" >' + CAST(SO3.SalesOrderNumber AS VARCHAR) + '</a>'
FROM Table1 T
LEFT JOIN Table2 SO3 ON SO3.SOKey=T.SOKey
WHERE T.TOLineKey=A.TOLineKey FOR XML PATH(''))1,1,'') AS SONumber
FROM Table1 A
GROUP BY A.TOLineKey
The query above will produce the following result for SONumber:
<a href="XXX.com/soinformation.aspx?SONumber=123456" >123456</a>
However, when I pass the data above to girdview, it actually display the HTML code as string. Also the HTML code is showing with character entities when I check the code in browser.
> <a href="XXX.com/soinformation.aspx?SONumber=123456">123456</a>
How should I edit my query for it to produce the correct HTML code to display in broswer?
I apologize if there was another similar question but I could not find one. Thank you for your help in advance.
3:35PM PST had to update my question for incorrect info provided.