Hot answers tagged

3

You need go add OfficeDev PnP Nuget package in your project. Depending on if you're developing for online or on-premise.


3

You can do that using Client Object Model C#. Add .dlls from NuGet in your MVC project. Install-Package Microsoft.SharePoint.Client.dll Here is an example. Don't forget to pass a credential. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint.Client; using Microsoft....


3

You need to have app web for that. In provider hosted app, app web is not present by default. Create an empty module or list in your app web; basically in SP project which gets created when you create a provider hosted app and then you will have context. Besides that, why do you need context of app web of you don't have anything in there?


2

Take a look at this post. Since SharePoint 2013 is built around the app model you have the option of using MVC4 MVC3 ASPX Web Forms or Silverlight. On SharePoint 2013 application pages or websites will not be integrated with the SharePoint Site as in 2010. You can read the below related post and see how you can do your mvc app. http://social.msdn.microsoft....


2

Your business requirements should dictate the technologies you use on this or any project. To make the right decisions on this you really need an experienced SharePoint architect. Building a SharePoint project of any complexity without one will almost certainly end in tears. That said, SharePoint is a huge product, and your team will almost certainly have ...


2

As a .Net developer, you can get an idea of SharePoint using the following links, http://msdn.microsoft.com/en-us/library/ff829215.aspx http://sharepoint-tutorial.net/post/2013/01/21/sharepoint-2010-development-overview.aspx http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/architecture-of-sharepoint-for-Asp-Net-developers/ https://www....


2

ASP.NET MVC is a completely different animal from SharePoint. For a start, SharePoint is built on ASP.NET WebForms. If you want to migrate an app from MVC to SharePoint, your only option is to rebuild the app from scratch, using things SharePoint has to offer, such as Features, Lists, Workflows, etc. If you have to merely host the MVC app on the SharePoint ...


2

Any list you deploy as part of you App will be added to the AppWeb (yes such a web is created when you add SharePoint items to your App, even though the App is Autohosted) not to the HostWeb


2

Ok so I found Microsoft.Identity.Extentions here: http://download.microsoft.com/download/0/1/D/01D06854-CA0C-46F1-ADBA-EBF86010DCC6/MicrosoftIdentityExtensions-64.msi That's needed for http://nuget.org/packages/AppForSharePointWebToolkit/ which creates TokenHelper.cs file. I still don't know why it didn't appear automatically when creating new project for ...


2

As Daniel says, if you are building an App, Provider Hosted or Auto Hosted which both have components that run off your SP2013 server, that remote part can be MVC (e.g. ASP.Net MVC4 or 5). If what you want to use is the concept, then yes you can definitely do that too. You can do SP2010 webparts (farm solutions) with a MV(C/VM) architecture, if you're ...


2

Here's an update to the provider I posted earlier that supports basic crud operations against a sharepoint 2010 (and probably 2013) List // SharePointListService.js (function () { "use strict"; var module = angular.module('sharePointList', []); module.provider('SharePointList', function () { var clientCtx; var web; var ...


2

Here is a provider I created to get data from sharepoint lists: (function () { //// SharePointListService.js "use strict"; var module = angular.module('sharePointList', []); module.provider('SharePointList', function () { var clientCtx; var web; var configuration = {}; this.$get = ['$q',"$log", function ($q,$log) { var contextLoaded =...


2

Have you added the SharePointContextFilter attribute to your CalculateHolidayTime action? You are correctly passing the SPHostUrl as a parameter - the filter is the bit that takes that SPHostUrl and adds a sharepoint context to the session (or reads an existing one). This is all assuming you've used the Visual Studio 'app for SharePoint' template which ...


2

I would strongly recommend not using SharePoint at all in this scenario, because: backup and restore is more challenging because you have to consider recovering the SharePoint boxes as well as SQL databases (and getting that right can be hard) you have to consider SharePoint's various restrictions on list sizes, file upload sizes, site collection sizes, ...


1

You don't mention what version of SharePoint you are using, but if you are using SharePoint 2013 or Online then you should look at the Provider Hosted App Model. This allows you to integrate a (mostly) standard MVC app with code first EF with SharePoint. The MVC app is actually hosted outside of SharePoint, and uses the client object model to communicate ...


1

Let me clarify some things first: You are correct, Auto-Hosted is no longer supported. If you get the newest Office Developer Tools for Visual Studio 2013 or 2015, you will see the option to create an Auto-Hosted App has been removed. You can get the latest tools using the Web Platform Installer. You do not need a SharePoint VM to build an App (also known ...


1

If you want to use the SharePoint app model then yes, you must allow posts. SharePoint sends authorization & authentication data to your app via post. Your app needs that data to generate a client context. Take a look at the tokenhelper.cs file and/or the landing page code behind & you should see the post data processing


1

I found the solution to my problem. I changed my code to use the ListItemCollection instaed of FileCollection and used a CAML query to filter. Also, since I still need the File object (for the server relative Url), I loaded it in the context: public IEnumerable<ListItem> FindBy(string fileName, ClientContext clientContext) { var documentLibrary = ...


1

Try this blog, http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/working-with-images-in-Asp-Net-mvc-framework/ Please let me know if you have any doubts. And mark as answer if this one helped.


1

I had a similar problem as you, with a null SharePointContext object. For me I was using the SharePointContextFilter Attribute on the Action method, and wrapping the ClientContext inside a using statement. [HttpPost] [SharePointContextFilter] public ActionResult FinaliseQuote(string quote) { var spContext = SharePointContextProvider.Current....


1

You're wrong asserting provider-hosted apps don't allow to handle AppInstalled event. It is absolutely possible. Refer to this documentation: Handle events in apps for SharePoint and to this sample: SharePoint 2013: Create a provider-hosted app that customizes app installation


1

If you want to create a single page application (SPA) app usually you have to choose a client side framework. Here is very short review of common SPA frameworks: JavaScript SPA-Frameworks Technically Knockoutjs is not a SPA framework, but MVVM two way data binding technique for your UI, Durandal JS is a SPA frame work that is built on Knockout JS base. If ...


1

FEDAuth cookie is essentially just a pointer. It tells SharePoint how to validate your credentials from the secure store service. It's probably much more trouble than it's worth to try and re-use that scheme as is. You could use ADFS or write a simple custom STS that can give you a custom token that both your service and SharePoint can accept. If you ...


1

This is what we are supposed to do. public ActionResult Upload(HttpPostedFileBase file) { var hostweb = HttpContext.Request["SPHostUrl"]; Uri hosturi = new Uri(hostweb); using (var clientContext = new ClientContext(hosturi)) { using (var fs = file.InputStream) { var ...


1

As I've understood it, it is possible to implement MVC into your SP2013 Apps but not into any SharePoint solutions or the like.


1

You can access SharePoint data using an App, you just cannot use SharePoint Server-Side Object Model code. But you could easily access and manipulate data using the SharePoint web services or client object model. If you really want to use Razor within SharePoint, it looks like all you need to do is use NuGet to add Razor to your project. You then build your ...


1

I am presuming that your app doesn't have the proper "read" permissions to see this list. Add the read permission to the AppManifest for the list service. This should then work.


1

You will need to use SharePoint web services unless a new feature is introduced in SharePoint 2013 and am not aware of it. For what you want you can use Rest API for CRUD operations on a list, Get started with the SharePoint 2013 REST service OR SharePoint 2013: Use the cross-domain library and REST for CRUD operations OR How to: Complete basic ...


1

What John said is true. You ought not directly interact with the SharePoint databases. However, when you state "Now I was asked to have all the data available in a 2007 Sharepoint Server" what it sounds like you actually need here is the Business Data Catalog service available in SharePoint 2007. It allows you to surface and interact with the data in your ...


1

SharePoint 2010 already exposes most of its content through its REST interface, implementation the ODATA protocol. Prior to develop something custom from scratch, I would seriously look into what's available, even in the free foundation edition. http://msdn.microsoft.com/en-us/library/ff521587.aspx I've built heavy client side applications nearly solely ...



Only top voted, non community-wiki answers of a minimum length are eligible