?
Solved

SharePoint Lists View in ASP page

Posted on 2009-07-06
8
Medium Priority
?
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

 

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 2000 total points
ID: 24831512
0
 

Author Closing Comment

by:NewItem
ID: 31600228
Good example.
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

765 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