RE: How to create a subsite thru code
From: Daniel Larson (www.portalbuilder.org) (daniel_at_larsontechnology.spamfree.com)
Date: 11/05/04
- Next message: Daniel Larson (www.portalbuilder.org): "Re: Non Domain computers get three requests for authentication"
- Previous message: Kyle Eberle: "Re: Does Msft Tech monitor this group?"
- In reply to: arjun: "How to create a subsite thru code"
- Next in thread: arjun: "Re: How to create a subsite thru code"
- Reply: arjun: "Re: How to create a subsite thru code"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Nov 2004 08:57:01 -0800
Arjun,
This is actually a pretty common mistake. You can't do anything to update
the site database on a GET request, it must be in response to a POST. (Button
click, etc.). You can get around this by doing this in a simple web service
wrapper and calling the web service from the GET request.
Daniel Larson
www.portalbuilder.org
"arjun" wrote:
> 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!
>
- Next message: Daniel Larson (www.portalbuilder.org): "Re: Non Domain computers get three requests for authentication"
- Previous message: Kyle Eberle: "Re: Does Msft Tech monitor this group?"
- In reply to: arjun: "How to create a subsite thru code"
- Next in thread: arjun: "Re: How to create a subsite thru code"
- Reply: arjun: "Re: How to create a subsite thru code"
- Messages sorted by: [ date ] [ thread ]