Solved

SharePoint Lists View in ASP page

Posted on 2009-07-06
8
384 Views
Last Modified: 2012-06-27
I am creating a ASP page which list all the content in SharePoint custom list view. The SharePoint site contain Title, Body Message, Image, doc and xls documents. The following is my code for listing the Title:

   Private Function GetListNode() As XmlNode

        Dim RCPILists As New engage.Lists()
        RCPILists.Credentials = New System.Net.NetworkCredential("TestUser1", "Pwd1", "Domain1")
        Dim TEXT1 As XmlNode = RCPILists.GetListItems("{A3621D46-5961-4B61-BC70-E2BFE7A31BC4}", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
        Return TEXT1

    End Function
   

    Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim node As XmlNode = GetListNode()
        Dim xr As New XmlTextReader(node.OuterXml, XmlNodeType.Element, Nothing)
        Dim ds As New DataSet
        ds.ReadXml(xr)
        SharePointListBox.DataSource = ds.Tables("row")
        SharePointListBox.DataTextField = "ows_LinkTitle"
        SharePointListBox.DataBind()

    End Sub
sharepoint-ListSetting.bmp
0
Comment
Question by:NewItem
  • 3
  • 2
8 Comments
 
LVL 11

Expert Comment

by:andrei_teodorescu
ID: 24827678
first of all, what are you trying to achieve? display the list in a table or in a listbox?
here you can find an easy method to load a SHP list into a ADO Datatable:
http://politechnosis.kataire.com/2009/02/reading-sharepoint-lists-into-adonet.html

second, here is how you can retrieve attachments:
http://blogs.msdn.com/sharepoint/archive/2007/03/25/retrieving-sharepoint-list-items-attachment-urls-using-lists-web-service.aspx
0
 

Author Comment

by:NewItem
ID: 24828042
I would like to get the content in the sharepoint forum, which included Title Text, Body Text, Image, xls/doc documents. Can Lists.asm collect all those information? When I go to AllItems.aspx I am only able to see Title but no body or image.
0
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 24829113
Why aren't you building this page directly in Sharepoint using Sharepoint Designer?

If you insist on using a non-Sharepoint site to access Sharepoint you need to use Sharepoint's web services.  You cannot use the Sharepoint API from non Sharepoint web applications.

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:NewItem
ID: 24829851
I have to use non-sharepoint site to access sharepoint content. It is because I have to join the sharepoint content with other webpage. Will I able to use "_vti_bin/Lists.asmx" to get all the list titles and list description, image and documents. I am new to sharepoint I am only able to get list title but nothing else from the xml content. Do I miss anything in the code? I tried different way but I only get the title of the list but not the content.
0
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 500 total points
ID: 24831512
0
 

Author Closing Comment

by:NewItem
ID: 31600228
Good example.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The viewer will learn how to dynamically set the form action using jQuery.
Viewers will learn how to use the Hootsuite Dashboard.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question