Created
July 3, 2020 18:54
-
-
Save xsolon/594dfdf312ffd3c1f340acd4b4ea6162 to your computer and use it in GitHub Desktop.
Minimal SpDataSource Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<%@ Page language="C#" %> | |
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint" %> | |
<html> | |
<body> | |
<form id="form1" runat="server"> | |
<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" | |
UseServerDataFormat="true" selectcommand="<View></View>" id="spdatasource1"> | |
<SelectParameters> | |
<asp:Parameter Name="ListName" DefaultValue="Site Pages"/> | |
</SelectParameters> | |
</SharePoint:SPDataSource> | |
<asp:Repeater runat="server" id="Repeater1" DataSourceID="spdatasource1"> | |
<ItemTemplate> | |
<asp:Literal ID="title" runat="server" Text='<%#Eval("Title") %>'></asp:Literal> | |
<asp:Literal ID="id" runat="server" Text='<%#Eval("ID") %>'></asp:Literal><br /> | |
</ItemTemplate> | |
</asp:Repeater> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment