Click here to Skip to main content
15,937,779 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900