By Code
  • Home
  • About
Sign in Subscribe

SharePoint-2010

A collection of 2 posts
SharePoint

Add / Remove event receivers to list / content types in SharePoint with PowerShell

Although it's simple but it's a little bit tricky. Adding / removing an event receiver to a list and content type is the same you just need to use the appropriate collection is an SPWeb object. Here is how to add / remove an event receiver to / from
05 Oct 2012 1 min read
SharePoint

Check whether a website exists in a site collection

The easiest way I found is // Checks whether a website exists by looking up its url in the current site collection bool WebExistsByUrl(string url) { return SPContext.Current.Site.AllWebs.Any(w => w.Url.Equals(url, System.StringComparison.InvariantCultureIgnoreCase)); } or even better you can put them in an extension
05 Oct 2012
Page 1 of 1
By Code © 2026
  • Sign up
Powered by Ghost