SharePoint 2007 – "Back" Link After Deleting a Site

After deleting a site in WSS 3.0 or MOSS 2007 the following page is displayed by default.  The “webdeleted.aspx” is a default application page provided by Microsoft, but it is easily customized.  In this article I will show you how to enhance this page to be more user friendly.

delete

The problem with this page is that the user is left hanging, with no links back to the parent site or site collection where the site was deleted from.  Below is a quick solution for adding a link labeled “Go back to parent site” to the top of this page.  When the steps are complete your users will see the following:

delete2

Steps for adding the “Go back to parent site” link.

  1. In notepad, open the file named “webdeleted.aspx” in the 12 hive, layouts folder (usually this is located at the following location: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS )
  2. Located the content placeholder tag: <asp:Content ContentPlaceHolderId=”PlaceHolderTitleBreadcrumb” runat=”server”>
  3. Add the following code inside the content placeholder:  <a href=”<%SPHttpUtility.HtmlEncode(SPControl.GetContextSite(Context).Url, Response.Output);%>”>Go back to parent site</a>
  4. Save the “webdeleted.aspx” file.

When you are finished the code should look like the following:

<asp:Content ContentPlaceHolderId=”PlaceHolderTitleBreadcrumb” runat=”server”>
     <a href=”<%SPHttpUtility.HtmlEncode(SPControl.GetContextSite(Context).Url, Response.Output);%>”>Go back to parent site</a>
</asp:Content>

4 Responses

  1. […] a quick post on how to add a “Back” Link After Deleting a Site in SharePoint […]

  2. […] SharePoint 2007 – “Back” Link After Deleting a Site […]

  3. […] webdeleted.aspx page is displayed by default. Scott Wheeler explains on his blog how you can put a “back to site” link on this […]

  4. In case someone need to navigate to top level site collection after this.. they can use $SPUrl then

Leave a comment