Reputation: 13
I have some data in sharepoint lists,I want to read particular data from the list and show them in my asp.net website,what should i do ?
I don't want use sharepoint linq.
Upvotes: 1
Views: 12813
Reputation: 16
You can use REST API to retrieve SharePoint list items. You can use REST API in C# and also in java-script.
The following is the java-script code which retrieves list (Employee) items from the sharepoint devsite using REST API.
<script type="text/javascript" src="https://name.sharepoint.com/sites/devsite/SiteAssets/jquery-1.9.1.min.js"> </script>
<script type="text/javascript">
$(document).ready(function () {
$('#getEmployee').click(function () {
$.ajax({
url: "https://name.sharepoint.com/sites/devsite/_api/web/lists/getbytitle('Employee') /items",
method: "GET",
headers: { "Accept": "application/json;odata=verbose" },
success: function (data) {
*** You can Parse your data under this function***
}
},
error: function () {
alert("Response fails");
}
})
})
})
</script>
<input type="button" value="GET" name="GET" id="getEmployee"/>
Upvotes: 0
Reputation: 822
You can read data from SharePoint in your ASP.NET Using SharePoint CSOM.
Client-Side Object Model (CSOM)
is mainly used to build client applications and enable us to access SharePoint Sites that are hosted outside without using web services.
What do you need in order to use CSOM?
You just needed to add the below assemblies as a reference to your solution to be able to work with the Client Object Model.
These assemblies can be found in the 14 Hive folder: %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\ISAPI.
So you should copy it first from your SharePoint Server to your solution folder then add it as a reference in your solution.
For Complete basic operations using SharePoint client library code check
Also, you can Accessing SharePoint 2010 Lists by Using REST-based web services
for more details/ examples check this MSDN article Accessing SharePoint 2010 Lists by Using WCF Data Services
Upvotes: 1
Reputation: 2493
Microsoft SharePoint 2010 introduces new REST-based web services by using Windows Communication Foundation (WCF) Data Services http://msdn.microsoft.com/en-us/library/hh134614(v=office.14).aspx Look at this answer: https://stackoverflow.com/a/18624371/820436
Upvotes: 1