I am trying to get a web using full url using CSOM
This one works,
var web = context.Web; context.Load(web, w => w.Webs); context.ExecuteQuery(); var subWeb = (from w in web.Webs where w.Title.Contains(accountId) select w).SingleOrDefault(); if (subWeb == null) return false; subSite = subWeb; // this subweb works for renaming the title return true;
But this one doesn’t work
using(var scontext = new ClientContext(subsiteUrl)) { scontext.AuthenticationMode = ClientAuthenticationMode.Default; scontext.Credentials = Credentials; scontext.ExecuteQuery(); Web sWeb = scontext.Web; scontext.Load(sWeb, sw => sw.Title, sw => sw.Url); scontext.ExecuteQuery(); subSite = sWeb; return true; }
subSite is a reference that I am passing in function parameter. This one doesn’t work for changing the title. What have I missed?