Thursday, July 11, 2013

MVC support for Apps in SharePoint 2013

Interesting? Yes, it is the most interesting and surprising news in VS2013 preview release. With Visual Studio 2013 preview now you can create Apps in MVC as well. When you are creating a new APP you can select between ASP.NET web forms and ASP.NET MVC.

These options can be available when you choose Auto-Hosted or Provider-Hosted app for SharePoint. We all know the SharePoint-hosted apps won't allow server side programming. :) When you created an app using ASP.NET MVC model then you see the same folders and structure as in mvc web site. Complete model is same as regular MVC implementation. The new things for you might be are the SharePoint filter and context files. The project provides a set of APIs, defined in the Filters\SharePointContextFilterAttribute.cs and Filters\SharePointContextFilterAttribute.vb, and SharePointContext.cs and SharePointContext.vb files for C# and Visual Basic projects respectively...

SharePointContextFilter: Filters can be useful for switching back and forth between SharePoint and remote web application. Mostly when the SharePoint site need authentication etc.

SharePointContext: This is for communicating the App with SharePoint objects.

To test the new implementation you should download the VS 2013 preview now and start doing the innovation things. :) Enjoy the new learning day to day. 

3 comments:

  1. Hello Praveen..Thanks a lot for your useful information.Really ASP.NET MVC is easy to use and more advantages.From asp mvc serverhosting you can get more information also.

    ReplyDelete
  2. Really new programming techniques for MVC with a SharePoint 2013 .I liked it..thanks for sharing ...

    ReplyDelete
  3. Good news and thanks for posting this.
    I really prefer web forms though, call me old fashioned

    ReplyDelete