Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: sharepoint2010
Hi experter,
i'm newbie in Sharepoint and have Problem by getting lists and subsites using siteid
with javascript:
so topsite->subsite1,subsite2
subsite1->subsite11,subsite12,subsite13
subsite2->subsite21,subsite22...
I have guid at subsite and would like to get all subsites from there.
My JavascriptCode:
currentcontext = new SP.ClientContext.get_current();// ('/sites/subsite1'); 
//    currentweb = currentcontext.get_web();
    site = currentcontext.get_site();
     //.get_serverRelativeUrl().toString();
    currentcontext.load(site);
    web = site.openWebById(subsite11ID);('/sites/subsite1/Subsite11'); 
    currentcontext.load(web);
     
//this.subsites = currentweb.get_webs();
    //this.subsites = currentweb.get_lists();
    this.subsites = web.get_serverRelativeUrl();--> error hier. Function is not initialized
 
currentcontext.load(this.subsites);
currentcontext.executeQueryAsync(Function.createDelegate(this, this.ExecuteOnSuccess),
Function.createDelegate(this, this.ExecuteOnFailure));
ClientContext accepts only relative Url
 
anyone can helps me? thanks a lot!
Posted 22-Nov-12 17:42pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 574
1 OriginalGriff 373
2 Damith Weerasinghe 355
3 thatraja 350
4 Abhinav S 230
0 Sergey Alexandrovich Kryukov 10,639
1 OriginalGriff 6,658
2 Peter Leow 4,735
3 Abhinav S 3,813
4 Maciej Los 3,565


Advertise | Privacy | Mobile
Web04 | 2.8.140421.2 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid