Click here to Skip to main content
Sign Up to vote bad
good
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:42


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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 364
1 Arun Vasu 223
2 OriginalGriff 190
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


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