Sharepoint subsite with urlname ‘images’, ‘m’, ‘lists’, ‘IWConvertedForms’ etc


In sharepoint, if we try to create subsite with urlname ‘images’, ‘m’, ‘lists’, ‘IWConvertedForm’ etc. Some of them are SharePoint reserved name. (These names are not the name of list like ‘Document Library’, ‘Calender’ etc), it doesn’t allow us to create. This is because these all folders already exist under RootFolder of web.

Programmatically this lists can be extracted as

public string[] GetAllSubFoldersFromRootFolder(string spSite)
{
try
{
using (SPWeb spWeb = new SPSite(spSite).OpenWeb())
{
if (spWeb == null)
return null;
if (spWeb.RootFolder == null)
return null;
string[] folderNames = null;
for (int i = 0; i < spWeb.RootFolder.SubFolders.Count; i++)
{
folderNames[i] = spWeb.RootFolder.SubFolders[i].Name;
}
return folderNames;
}
}
catch
{
return null;
}
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s