By Code
  • Home
  • About
Sign in Subscribe

SPSite

A collection of 1 post
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