Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Combine two fields from Data View to build hyperlink in SharePoint

  Asked By: Nadia    Date: Nov 24    Category: MOSS    Views: 3189

I'm displaying an employee listing using a Data Source in SharePoint Designer,
(SharePoint 2007). One of the columns contains the file name of the employee's
picture. The file name does not include the path. I want to display a
hyperlink that will link to the picture. I want to append the server path to
the column value. How can I do this?

Here is what I've tried:

Original column:
<td class="ms-vb">
<xsl:value-of select="@PhotoFile"/>
</td>

What I want it to be:
<td class="ms-vb">

<asp:HyperLink runat="server" id="HyperLink1{generate-id()}"
NavigateUrl="file://ds-web/studentphotos/facstaff/893.jpg"
Target="_blank">Employee Photo
</asp:HyperLink>

</td>

Except, I want to append the file name to the file location:

"file://ds-web/studentphotos/facstaff/893.jpg" & <xsl:value-of
select="@PhotoFile"/>

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Rahul Sharma     Answered On: Nov 24

Here is how I solved this:

<asp:HyperLink runat="server" id="HyperLink1{generate-id()}"
NavigateUrl="file://ds-web/studentphotos/facstaff/{@PhotoFile}"
ImageUrl="mbaportal.darden.virginia.edu/.../Pe
rsonIcon.gif" Target="_blank">Photo</asp:HyperLink>

 
Answer #2    Answered By: Jagjit Phutane     Answered On: Nov 24

Not sure if it's applicable, but tidbits from my blog post may help you:

spinsiders.com/.../the-category-page-in-a-sharepoint-blog-s\
ite/

 




Tagged: