Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Create a subsite from event receveir of the type ItemAdd

$
0
0

Hi;

I have a event receveir on a ItemAdd and I would like to create a new subsite when a new item is added into a custom list (LIST).

I have tried this example (http://sharepoint247.com/sharepoint2010/sharepoint-2010-event-handler-to-create-subsites/) but not working for me.

My code source is :

base.ItemAdded(properties);

SPWeb web = properties.OpenWeb(); 
if (properties.List.Title == "LIST")  
  {  SPListItem curItem = properties.ListItem;

SPWeb newSite = web.Webs.Add("test", "test", "test", (uint)1033, "#$0", false, false); 
                   newSite.Update();
                   newSite.Close();

}

The command web.Webs.Add not working : any action and any error ?

Regards



Viewing all articles
Browse latest Browse all 11571

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>