Gets the name.
The name is a short textual description of the item, like a filename in Windows. The name is not language-specific. The Key of an item is Name in lowercase.
To change the field values or name of an item, the item must be in editing mode. An item can enter editing mode by calling BeginEdit and leave using EndEdit. If the item is being edited without being in editing mode, an exception is raised. Changes to the items, is committed to the database when the editing mode is left.
This example gets the names of the subitems that has the Document template.
public string GetDocumentNames() {
string result = "";
Item item = Sitecore.Context.Database.Items["/sitecore/content/Home"];
foreach(Item child in item.Children) {
if (child.Template.Name == "Document") {
result += child.Name + ",";
}
}
return result;
}
Item Class | Sitecore.Data.Items Namespace