As usual, when you try to install the whole thing in IIS you always get errors from the web services. Normally this errors are related with security, and normally you spend more time trying to figure out WHY than developing the code. It is part of the new OS's bussines, security.
This issue normally comes when you are not able to do a call from the web browser, to avoid these problems you just need to set your SPWeb object as xxx.AllowUnsafeUpdate = true, so looking my previus code we will add the line in red.
...
SPWeb parentWeb = siteCollection.OpenWeb();
SPWebTemplateCollection Templates = siteCollection.GetWebTemplates(Convert.ToUInt32(LCID));
SPWebTemplate _sptSiteTemplate = Templates[_iSiteTemplateNumber];
if (parentWeb.Webs[_sSiteURLRequested].Exists)
{
parentWeb.Webs.Delete(_sSiteURLRequested);
}
parentWeb.AllowUnsafeUpdates = true;
parentWeb.Webs.Add(_sSiteURLRequested, _sSiteTitle, "", Convert.ToUInt32(1033), _sptSiteTemplate, false, false);
...
Tuesday, 26 August 2008
(0x8102006D): The security validation for this page is invalid
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment