WebDeleting Event for New Sites created ? ?

Nik J
  • WebDeleting Event for New Sites created ? ? Nik J

    I am using the WebDeleting event which is based on features. Just activate the feature, and whenever a web is getting deleted, the event handler throws a message saying "Web can't be deleted".

    Everything works fine for all the existing sites. But suppose a client adds 5-10 sites? How should I go about attaching the event handlers to new sites which are created?

    I thought of going for Job Schedulers which work on attaching every minute or second.. Or is there another approach? Please provide links if any.

  • It sounds like you want to use Feature Stapling to bind your feature to new sites.

Tags
2007 event-handlers feature-activation feature
Related questions and answers
  • a complete inventory of sites and the template it uses without much code. Would love to do this from the UI. This can give an idea of sites we can safely delete. 2.) I am under assumption that we can delete the stp as required and current sites based off the deleted template will still be intact? I just don't want current sites to be impacted. 3.) Lastly, Outside as deploying templates...I am currently on a project where I have been asked to clean up the Site Template gallery from various collections across the organization. One of the offending web apps has one site collection

  • So I have been asked the following question: When a site collection or one of it's web sites are deleted, is this data purged from the database, or is this data otherwise marked as deleted but kept as entries? Any ideas? Thanks.

  • I am trying to create a feature that uses the API for associating an ItemAdded event receiver to a Discussion List. I was associating the Event Receiver to the SPList, however, i don't want the event to fire when Replies are created (Message Content Type), only when Threads (i.e. Discussion Content Types) are created. In my situation, I have a Feature Receiver and essentially the following code: SPWeb web = properties.Feature.Parent as SPWeb; if (web.Lists["Team Discussion"].ContentTypes["Discussion"].EventReceivers == null) throw new Exception("null ...darn"); Will SharePoint allow me

  • have list of sites and sub-sites with URL's. More details: Let me describe one solution I have now. I’ve found tool Data Juggler (http://www.djuggler.com/) which can automate repetitive web tasks... manually. It was big effort to take all data together, but once this was done, it is easier to maintain, as new sites/sub-sites are created occasionally Information in this spreadsheet are in this order... this database and get list of all users which have access to site mysubdomain.mydomain.com/sites/xyz where xyz is set of sites and to complicate it more, there is also abc which represents sub-sites

  • I was working on a project to provide Up Button functionality for the list view web part, and ran across this functionality in the Reusable Content popup. I opened reflector and set to work to reverse the engineer the code for use on any list view. While doing so I created an error on the Reusable Content page (I believe it is called ReusableContentPicker.aspx but I am away from my VM and can't check.) and deleted the list view web part that was displaying the Reusable Content list from the page in web part maintenance mode. Not enough coffee that morning (>_<) Now when I load the page

  • changes to a site definition to the sites that have been created from it. Changes to web templates only affect new sites that are created from them. My understanding was that this is not the case with site definition schemas (and list definition schemas). I understand that you can only add to a definition once a site has been created from it or the sites will break, but I saw the note on this page...There have been several questions asked on this site regarding the best way to provision sites and lists (definition schemas vs. templates vs. the object model vs. the web interface vs. provisioning

  • to the Pages library. This correctly provisions the page to the Pages library with an Announcements List View web part provisioned to the page. I have about 800 (or so) sites created from this site definition. We have a need to add a few web parts to the page for any new sites created from the template and also for all of the existing 800 sites. The plan was to move the default.aspx module from ONET... existing sties. New sites would pick it up via the feature. When I do this I can deactivate and reactivate the feature to correctly replace the home page with the "latest version". However, when I

  • I'm trying to creat a calender event that will be an all day event and will repeat every year from a list that has everyone's birthday. The recurrence works great and so does the All day event. The problem is when I set newBirthDay["All Day Event"] = 1; the recurrence all of a sudden doesn't put the event in the correct day, but in the next day. So say your birthday is on the 8th month and 3rd day, it will actually show up on the calender on August 4th and this only happens when I try to make it an All Day Event. If I leave it as normal it will show up on the correct day August 3rd. Anyone

  • appropriately. I can see the status change on the Solution Management page from deploying to deployed. There are no errors in the trace logs or event viewers. However, the 12 hive only contains files..., Deploy Solution - left with the same files as I started Run ProcessMon while upgrading the solution - I could see where the cab was unpacked in the temp directory, then promptly deleted. Finally, we were lucky enough to still have the soon to be decommisioned server that previously ran Central Admin (Server1). So, I added the server to the farm. Removed the Central Admin from the new Server

Data information