Get a sharepoint list item guide

Im using an SPDataSource to bind a sharepoint list to a relay controller

inside the repeater itemtemplate I use things like

<% # Eval ("Title")%>

im trying to get id for list item, ideally something like guid eg

but the above doesn't work ... how can i get the manual? btw i did <% # Eval ("ID")%> it worked but it returns a number like 1, 2, 3 ..

Ideally, I want something more than guidance.

thank

+2


source to share


4 answers


Ugly but works

<%# ((SPListItem)((SPDataSourceViewResultItem)Container.DataItem).ResultItem).UniqueId %>

      

Don't forget to add

<%@ Import Namespace="Microsoft.SharePoint" %>   
<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 

      



The easy way

<%# Eval("UniqueId") %>

      

works only if you set IncludeHidden to true on your SPDataSource

+3


source


The SPListItem UniqueId property is a unique identifier for an item.

So try



<%# Eval("UniqueId") %>

      

Pay attention to the case sensitivity.

+1


source


Try <%# Eval("UniqueId") %>

+1


source


The GUID for the list item is stored in SPListItem.UniqueId .

0


source







All Articles