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 to share