Monday, 3 March 2014

How to add SharePoint list in aspx page using Visual Studio in SPO

How to add SharePoint list in aspx page using Visual Studio in SPO
Open VS 2012
Create new SharePoint App
Right click on project
add new item
Select List: Remember the list name.
Add some columns
Now open Pages
Open .aspx page
Add below code in in side asp:Content
<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="full" Title="loc:full" >
<WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart1" runat="server" ListUrl="Lists/<List name>" IsIncluded="True" NoDefaultStyle="TRUE" Title="My POC" PageType="PAGE_NORMALVIEW" Default="False" ViewContentTypeId="0x">
</WebPartPages:XsltListViewWebPart>
</WebPartPages:WebPartZone>
Save
Start with out debugging
Click on I trust
It will open your aspx page
you can find your list