Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > problem displaying link to a document using Guid View modes: 
User avatar
Member
Member
anna.goldberg-jonassoftware - 8/6/2009 3:42:52 PM
   
problem displaying link to a document using Guid
Hello,

I am using cms File Upload from CMS Desk to upload pdf files. I read pdfs using the ViewFile.aspx.cs functionality, i.e I pass nodeID and get corresponding node with DocumentHelper.GetDocument.

I am trying to implement an opposite functionality of pulling nodeId from NodeGuid, which is explained here:

http://devnet.kentico.com/Knowledge-Base/API-and-Internals/How-to-display-link-to-a-file-or-document-without-.aspx

The problem is that GetNodeIdByNodeGUID function returns 0 as nodeId for some reason, even though the nodeGuidParam exists

This is my ascx page (I use it in Layout for my template)

<cms:cmsrepeater ID="rptLoadPDFfiles" WhereCondition="Hide=0" runat="server" ClassNames="CMS.pdf" SiteName="ClubHouseOnline">
<ItemTemplate>
<a href='<%# ReturnUrlSrc(Eval("Guid").ToString()) %>'><%# Eval("Name") %></a>
</ItemTemplate>
<SeparatorTemplate>
<br />
</SeparatorTemplate>
</cms:cmsrepeater>


What am I doing wrong? thank you!

User avatar
Member
Member
anna.goldberg-jonassoftware - 8/6/2009 4:30:36 PM
   
RE:problem displaying link to a document using Guid
After thinking it all through, my actual question is
why do I have all 0s key written into database, when I am trying to upload files using cms File Upload from CMS desk: 00000000-0000-0000-0000-000000000000

I am guessing this is the reason I can't pull file's nodeID from ReturnUrlSrc

User avatar
Member
Member
anna.goldberg-jonassoftware - 8/7/2009 10:33:15 AM
   
RE:problem displaying link to a document using Guid
never mind -

was able to solve it with:

CMS.TreeEngine.TreePathUtils.GetAttachmentUrl(nodeGUID, nodeAlias)

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/10/2009 7:53:59 AM
   
RE:problem displaying link to a document using Guid
Hello,

Thank you for your update. Hope it will help you others if they have the same problem.

Best regards,
Helena Grulichova