none
How to access SharePoint Context using Javascript Code not embedded in a Sharepoint Page ou WebPart ? RRS feed

  • Question

  • Hi

    I would need to develop a .net custom server control for a .Net Application hosted outside of the SharePoint Server.
    I want this Custom control to be able to navigate through a Specific SharePoint Document Library in order to select documents.
    So I am wondering if I can use javascript client object model to access this document library.

    Alll exemples of code I found on internet doesnt seem to allow the ClientContext Method to take credentials as parameters

    var clientContext = new SP.ClientContext(url);
    var website = clientContext.get_web();

    Also, as for the navigation component, do you think using jQuery Addon (like JsTree https://www.jstree.com/) is the best technical solution to go for or do you have a better suggestion to help me with what I want to achieve ?

    Thanks a lot for your help

    Regards

    Friday, February 17, 2017 9:44 AM

All replies

  • You requirement most probably is like this

    https://www.codeproject.com/Tips/566370/Developing-Sharepoint-Windows-Forms

    Thanks

    Kislay

    Mark as answer if it resolves your query

    Friday, February 17, 2017 1:37 PM
  • Hi Kabylie,

    One option is to use REST API to access the document library and then bind it to a tree view for navigation, a demo would be helpful:

    UNLIMITED FILES AND FOLDERS HIERARCHY IN SHAREPOINT ONLINE USING REST API

    Thanks

    Best Regards


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

    Monday, February 20, 2017 7:15 AM
  • Hi Jerry

    Thanks a lot for your help.

    Also do you know if jstree is good conpoment to use or do you know a better one ?

    Thanks

    Regards

    Kabylie

    Monday, February 20, 2017 9:37 AM
  • Hi Kabylie,

    JSTree is a third party JavaScript navigation, it can also achieve the similiar requirement to bind the data as navigation node, but you will also need rest api to access document library data and then bind to the JSTree.

    The better one I can figure will like the link above, please refer the demo above.

    Thanks

    Best Regards


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

    Monday, February 20, 2017 9:52 AM
  • Hi Kabylie,

    Is there anything updates ?

    Thanks

    Best Regards


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

    Thursday, February 23, 2017 12:21 PM
  • Hi Jerry Finally, i dont need anymore to develop a such component. Thanks a lot Jerry for your help. Take care Regards

    arioule

    Tuesday, February 28, 2017 8:35 PM
  • Hi Kabylie,

    Thanks for your sharing and I would suggest you can post the solution and then mark it as answer if it is possible so that it could help others who stuck with the same issue in the forum.

    Best Regards


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

    Wednesday, March 1, 2017 1:23 AM