Solved

SharePoint Lists View in ASP page

Posted on 2009-07-06
8
385 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Easy filter aspnet 2 25
looking for an ASP.net report designer 4 9
WordPress 8 29
WordPress: Debugging from my Windows 10 Desktop 6 33
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to count occurrences of each item in an array.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

860 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