locked
App parts and web parts RRS feed

  • Question

  • I have been searching the internet for days now and can't find a clear answer to the questions below. 

    Can you write web parts with code behind on a provider hosted web server?

    If so, will the user be able to add your custom web parts running on your provider hosted web server to SharePoint Site Pages?

    If not, is the only solution to use App Parts that do not allow any code behind?

    I do already know you can have app pages that run on a provider hosted web server with code behind and users are allowed to add that App to a SharePoint Site (I assume that would still be called a site page but would run outside the SharePoint environment).  I am looking for answers on web part and app parts.  Where can they run?  Do they show up in the web part gallery......etc.

    FYI, this is a private hosted SharePoint environment but we are not allowed to deploy any dll's to that environment.  All managed C# code will be running on provider hosted server.

    Thanks in advance,

    Dan


    Dan Marth


    • Edited by Dan Marth Friday, October 25, 2013 4:11 PM
    Friday, October 25, 2013 4:07 PM

Answers

  • Ok, I will try to answer my question since I always hate to find those posts that have the exact question I do with no answer.  Please, feel free to correct me if I am wrong.

    You can write web parts with code behind but now there are two options.  If you choose a "SharePoint Solution" project in Visual Studio, your options are just like in the past.  Web Parts and application pages that deploy server side code to the SharePoint environment.  It seems to me the "new"........and "Preferred" method is an "App for SharePoint 2013".

    If you chose the project type, "App for SharePoint 2013" you do not have the option for the old web parts or application pages that run in the SharePoint environment.  Instead, you have the option for a web page and web parts (aka Client Web Part) that are available within SharePoint via the "App Store".

    Another option that is very important is how you want your app hosted.  If you chose SharePoint-hosted, you can only have client side code.  if you chose Provider-hosted or Autohosted, you can have both client side code as well as server side. 

    So.......to answer my own question.  In the new 2013 environment, the only thing I see that has changed is the new option to create the project "App for SharePoint 2013" which just means your applications and web parts WILL be available to the SharePoint environment via the App Store but any code behind will NOT be deployed to the SharePoint environment.  Everything server side will run on your "Provider-hosted" web server.  If you don't have a "Provider-hosted" web server than you only have client side code as an option.

    Hope that helps someone looking for the same answers I was. Now, if Microsoft would stop moving the damn cheese every version it would make my life much more simple :)


    Dan Marth


    • Edited by Dan Marth Tuesday, October 29, 2013 4:55 AM Grammer
    • Marked as answer by Dan Marth Tuesday, October 29, 2013 5:02 AM
    Tuesday, October 29, 2013 4:48 AM

All replies

  • Ok, I will try to answer my question since I always hate to find those posts that have the exact question I do with no answer.  Please, feel free to correct me if I am wrong.

    You can write web parts with code behind but now there are two options.  If you choose a "SharePoint Solution" project in Visual Studio, your options are just like in the past.  Web Parts and application pages that deploy server side code to the SharePoint environment.  It seems to me the "new"........and "Preferred" method is an "App for SharePoint 2013".

    If you chose the project type, "App for SharePoint 2013" you do not have the option for the old web parts or application pages that run in the SharePoint environment.  Instead, you have the option for a web page and web parts (aka Client Web Part) that are available within SharePoint via the "App Store".

    Another option that is very important is how you want your app hosted.  If you chose SharePoint-hosted, you can only have client side code.  if you chose Provider-hosted or Autohosted, you can have both client side code as well as server side. 

    So.......to answer my own question.  In the new 2013 environment, the only thing I see that has changed is the new option to create the project "App for SharePoint 2013" which just means your applications and web parts WILL be available to the SharePoint environment via the App Store but any code behind will NOT be deployed to the SharePoint environment.  Everything server side will run on your "Provider-hosted" web server.  If you don't have a "Provider-hosted" web server than you only have client side code as an option.

    Hope that helps someone looking for the same answers I was. Now, if Microsoft would stop moving the damn cheese every version it would make my life much more simple :)


    Dan Marth


    • Edited by Dan Marth Tuesday, October 29, 2013 4:55 AM Grammer
    • Marked as answer by Dan Marth Tuesday, October 29, 2013 5:02 AM
    Tuesday, October 29, 2013 4:48 AM
  • Dan, I've been trying to reach you its Rick Bice we worked at LM together. Please email me Richard.m.bice.2@gmail.com
    Tuesday, April 21, 2015 2:24 PM