locked
C# or JavaScript for SharePoint Customization RRS feed

  • Question

  • Customization options in SharePoint 2013 and Office 365 are different. In OnPremise, visual web parts and other concepts can be implemented in C# code and in Office 365, customization in apps can be done in JavaScript. So, which is the preferred approach going forward and are there any guidelines to choose which one to opt for.

    Monday, April 18, 2016 11:12 AM

Answers


  • nowdays if there is a chance that your site will be moved to Sharepoint Online at some point, use javascript object model. Sharepoint 2013 has very convenient ScriptEditorWebPart (available under Media and content category in web parts list in ribbon), which allows to inject custom javascript on any publishing page. If your are sure that your site will always run on-premise, decide which is closer to your developers skills. In this case you may use either standard object model (server C# code) or javascript object model. Javascript won't require update of wsp packages on the server, but from other side not all operations which are available in standard object model are available in javascript, and server code may be more familiar to developers which worked with previous Sharepoitn versions. So decide here by yourself which one matches your requirements better.

    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

    • Proposed as answer by sk2014 Friday, April 22, 2016 6:58 AM
    • Marked as answer by Patrick_Liang Friday, May 6, 2016 9:11 AM
    Monday, April 18, 2016 2:18 PM
  • Hi,

    In SharePoint 2013 On-Premise, we can use can create farm solution(C# with SSOM) , SharePoint hosted add-ins, SharePoint Provider Hosted add-ins to achieve your requirement.

    In SharePoint 2013 Online(Office365), we can use SharePoint hosted add-ins(JavaScript with REST API or JSOM), SharePoint Provider Hosted add-ins(C# with CSOM and low trust) to achieve your requirement.

    If you only want to customize SharePoint 2013(On-premise or Online) UI, we can use JSLink or use Script Editor web part or content editor web part with JavaScript code to achieve it.

    More information:

    https://msdn.microsoft.com/en-us/library/office/jj164084.aspx?f=255&MSPPError=-2147217396

    Best Regards,

    Dennis


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by sk2014 Friday, April 22, 2016 6:58 AM
    • Marked as answer by Patrick_Liang Friday, May 6, 2016 9:11 AM
    Tuesday, April 19, 2016 7:38 AM

All replies

  • Depends what you want to accomplish.  You can't make web parts with JavaScript.  You can't make quick page modifications with C#.


    Steve Clark, MCTS
    Easy Bins Roll-off Dumpster Rentals in Northern VA
    Specializing in:
    Driveway-sized, roll-off dumpster rentals in Fairfax VA | Dumpster Rentals for Junk Hauling in Springfield VA
    Roll-off Rental Dumpsters in Annandale, VA

    Monday, April 18, 2016 1:27 PM

  • nowdays if there is a chance that your site will be moved to Sharepoint Online at some point, use javascript object model. Sharepoint 2013 has very convenient ScriptEditorWebPart (available under Media and content category in web parts list in ribbon), which allows to inject custom javascript on any publishing page. If your are sure that your site will always run on-premise, decide which is closer to your developers skills. In this case you may use either standard object model (server C# code) or javascript object model. Javascript won't require update of wsp packages on the server, but from other side not all operations which are available in standard object model are available in javascript, and server code may be more familiar to developers which worked with previous Sharepoitn versions. So decide here by yourself which one matches your requirements better.

    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

    • Proposed as answer by sk2014 Friday, April 22, 2016 6:58 AM
    • Marked as answer by Patrick_Liang Friday, May 6, 2016 9:11 AM
    Monday, April 18, 2016 2:18 PM
  • Hi,

    In SharePoint 2013 On-Premise, we can use can create farm solution(C# with SSOM) , SharePoint hosted add-ins, SharePoint Provider Hosted add-ins to achieve your requirement.

    In SharePoint 2013 Online(Office365), we can use SharePoint hosted add-ins(JavaScript with REST API or JSOM), SharePoint Provider Hosted add-ins(C# with CSOM and low trust) to achieve your requirement.

    If you only want to customize SharePoint 2013(On-premise or Online) UI, we can use JSLink or use Script Editor web part or content editor web part with JavaScript code to achieve it.

    More information:

    https://msdn.microsoft.com/en-us/library/office/jj164084.aspx?f=255&MSPPError=-2147217396

    Best Regards,

    Dennis


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by sk2014 Friday, April 22, 2016 6:58 AM
    • Marked as answer by Patrick_Liang Friday, May 6, 2016 9:11 AM
    Tuesday, April 19, 2016 7:38 AM
  • Hi,

    Any update?

    Thanks


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Monday, April 25, 2016 2:28 AM
  • In the below article, they are advising to use only App Model for the customization and Farm Solutions for admin relation tasks. But here I am suggested to use which suits my requirement. I would like to figure what is the standard and preferred development mode keeping future in-mind. 

    https://msdn.microsoft.com/EN-US/library/jj163114.aspx

    Monday, April 25, 2016 10:08 AM