0

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?

3

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.