Solved

SharePoint Lists View in ASP page

Posted on 2009-07-06
8
382 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:tedbilly
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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:
tedbilly earned 500 total points
ID: 24831512
0
 

Author Closing Comment

by:NewItem
ID: 31600228
Good example.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now