Share via


Updates are currently disallowed on GET requests. while creating a WSS site

This exception occurs when your try to create a WSS site from an Asp.Net application. Please make sure that the site creation code should NOT execute when Page.IsPostBack equal false. and please insert the below code snippets in the page load event. Sometimes you may required to impersonate the user.

Inserted the below code snippet in Page load event.

SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
Context.Items[SPGlobalAdmin.RequestFromAdminPort] = true;
Page.RegisterHiddenField("__REQUESTDIGEST", globalAdmin.AdminFormDigest);