Error on web.Webs.Add, Invalid Characters
-
01-10-2020 - |
Domanda
I'm currently trying to create a Sub Web on a Site. The problem I'm faced with is that for some reason I'm getting an strange error message.
Additional information: "
http://dev-env/sites/site/subsite/
" contains invalid character ':'.
As far as I can tell I'm not using any invalid characters.
elevatedWeb.Webs.Add(strWebUrl, title, strDescription, nLCID, WebTemplate, uniquePerms, bConvertIfThere);
Any tips?
Soluzione
This is because you are passing the full url instead of relative url
Replace
http://dev-env/sites/site/subsite/
With
subsite
i.e
elevatedWeb.Webs.Add(title, title, strDescription, nLCID, WebTemplate, uniquePerms, bConvertIfThere);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange