SharePoint BCS creating a hyperlink column

Tag: sharepoint , sharepoint-2010 , bcs Author: wwwscut Date: 2011-03-06

I am using the .NET connector to connect to an SQL database. One of this value is a URL. Now I need to display this as a URL.

Any ideas on how to solve this?

I assume you want to GET the url(s) from the SQL server and SAVE them in a SharePoint list column?

Best Answer

In Sharepoint Designer you can edit the read list and go to the field, so for example you have a field called URL, display it as a label so it would render like

<asp:Label runat="server" id="ff1{$ID}" text="{$thisNode/@URL}" />

Then all you need to do is add an "A href" tag to it so it renders as a url like such

<a href="{$thisNode/@URL}"><asp:Label runat="server" id="ff1{$ID}" text="{$thisNode/@URL}" /></a>

enter image description here


Ah, alrighty then. I'll have a go at that tomorrow if I remember - thanks for your help! +1, and +50 :)
Works for me, too. Great tip. I hadn't customized XSLT for the standard list view yet, so that took me a second to find out that the XSLT isn't viewed like your sample until you make an initial edit.