Created
July 8, 2015 03:20
-
-
Save davehax/f01b477a79ec0e94652a to your computer and use it in GitHub Desktop.
'Inline' layouts page to check if a Site Collection exists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> | |
| <%@ Assembly Name="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> | |
| <%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%> | |
| <%@ Import Namespace="Microsoft.SharePoint" %> | |
| <%@ Page Language="C#" AutoEventWireup="true" Inherits="Microsoft.SharePoint.IdentityModel.Pages.IdentityModelSignInPageBase" %> | |
| <script runat="server" type="text/C#"> | |
| protected void Page_Init(object sender, EventArgs e) | |
| { | |
| try | |
| { | |
| string site = Request.Params["Site"]; | |
| using (SPSite spsite = new SPSite(site)) | |
| { | |
| Response.Write(true); | |
| } | |
| } | |
| catch | |
| { | |
| Response.Write("false"); | |
| } | |
| finally | |
| { | |
| Response.End(); | |
| } | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment