How to create a subsite thru code

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: arjun (arjun.chakraborty_at_gmail.com)
Date: 11/05/04


Date: 5 Nov 2004 06:14:07 -0800

Hi All,
I am trying to create a subsite in a sharepoint portal using the
following code
       Site = New SPSite("http://localhost:8019/sites/test/")
    Site.AllowUnsafeUpdates = True
    Webs = Site.AllWebs()
        web = Webs.Add("first12", "first", "first",
Convert.ToUInt32("1033"), SPWebTemplate.WebTemplate.TeamSite, False,
False)

But the code is giving me the following error
Updates are currently disallowed on GET requests. To allow updates on
a GET, set the 'AllowUnsafeUpdates' property on SPWeb
I have administrative privilages on the site.

Please help!



Relevant Pages

  • Re: FP 2003 subsite page counter problem has appeared
    ... Follwoing these I have noticed on newly created subsite pages that the page ... on updates performed previously the counters continue to work. ... It appears to be a server-side isssue. ... I have no idea how to fix this, since I don't use FrontPage. ...
    (uk.net.web.authoring)
  • FP 2003 subsite page counter problem has appeared
    ... I have recently encountered an annoying problem with my web site. ... Follwoing these I have noticed on newly created subsite pages that the page ... on updates performed previously the counters continue to work. ...
    (uk.net.web.authoring)