Friday, June 26, 2015

Simple way to Add ListView Webpart in SitePage

We have so many option to add listview webpart in sitepage. Here, I am going to tell one of the simple method.

First create a module for site page. Then create a page under sitepage module. Open element.xml file. We can able to see <File> node of created sitepages. Insert the <view> node with their properties. For Example:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="SitePages" Url="SitePages">
    <File Url="test.aspx" Type="GhostInLibrary">
      <View List="TestList" BaseViewID="0" WebPartZoneID="Left" WebPartOrder="0" />
    </File>
    <File Url="test1.aspx"/>
  </Module>
</Elements>


Now Deploy the solution in web application. List view will be displaying in sitepage.

No comments:

Post a Comment