简体   繁体   中英

Sharepoint Online: Show List as part of the .aspx site

What are the possibilities to show a list as a part of a .aspx site? I need this to show two different lists on one page. It would also be optimal if the standard list functions like sorting etc. would still be available.

Is there a way to show the "native" Sharepoint List as en embedded part of the web site?

I already tried out to show the list data via GridView. But this has the disadvantage that I can't sort the list anymore.

Can someone help? Important: I need to use the client object model! I need a solution for Visual Studio projects!

You can try to integrate a list (app) as described in the OOTB part of this answer by adding it directly onto the .aspx page

Working with web parts within a SharePoint app by Chris O'brian

Adding a list view to SharePoint 2013 app pages in short:

<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="full" Title="loc:full" >
    <WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart2" runat="server" ListUrl="Lists/[URL of the list]" IsIncluded="True" NoDefaultStyle="TRUE" Title="Images used in switcher" PageType="PAGE_NORMALVIEW" Default="False" ViewContentTypeId="0x">
    </WebPartPages:XsltListViewWebPart>
</WebPartPages:WebPartZone>

The OOTB way

Use the List View WebPart as described here List View Web Part . This is out of the box with also the default functionality of a sharepoint list.

1) Go to a list where you want to have the lists
2) Edit Page
3) Click on the Insert Tab and select WebPart
4) Select Apps in Categories
5) Select the list you want to add to the page on the right list
6) Save the page

SPGridView

You can also use the SPGridView to display the Listitems. But in this ase you have to implement the out of the features like sorting, filtering etc.

Create a Grid by HTML

You can also render the contents of a list by using default HTML tables. This is not a so fine way, but you also need to implement here manually all the thing like sorting etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM