Deleting Managed Path




Go back to index

How to delete managed path


Following code block explains how to programmatically delete a managed path from a web application.

      using System;
      using SPTool.Library;
      using System.Collections.ObjectModel;
 
      namespace SPTool.Test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  SPTWebApplication webApplication = new SPTWebApplication("http://sptool/");

                  // Delete Managed Path
                  SPTReturn returnObj = webApplication.DeleteManagedPath("blogs");

                  // Check the status of managed path deletion
                  if (returnObj.State == SPTState.Success)
                  {
                      // Successfully deleted managed path
                  }
                  else
                  {
                      // Deleting managed path failed
                  }
              }
          }
      }
      


Go back to index