Sitefinity CMS
Search Sitefinity 3.x and older versions
Contents
Introduction
What is New in This Sitefinity Version
Readers Guidelines
Installation
Core Concepts
Sitefinity in Visual Studio
Sitefinity Building Parts
Developing with Sitefinity
Data Access
Pages
Controls
Modules
Adding New Modules to Sitefinity
Modules API
Modules API Overview
Generic Content
Overview of Generic Content API
Important Interfaces of Generic Content Module
Content Items
Comments
Categories
Tags
Tags Overview
Creating Tags
Finding Tags
Modifying Tags
Deleting Tags
Generic Content Based Modules
Lists
Polls
Forums
Newsletters
Services
Programming Security
Personalization Framework
Designing with Sitefinity
Security
How-to
API Reference
PID463; RID7; VID0; IsStatic1
Deleting Tags
Send comments
on this topic.
See Also
Developing with Sitefinity > Modules > Modules API > Generic Content > Tags > Deleting Tags
Glossary Item Box
There is one method for deleting a tag:
DeleteTag(Guid tagId) -
Pass the ID of the tag that will be deleted
Delete a category by specified ID:
DeleteTag(Guid tagId)
Copy Code
// create new instance of ContentManager
Telerik.Cms.Engine.ContentManager contentManager =
new
Telerik.Cms.Engine.ContentManager();
// get all tags
IList listOfAllTags = contentManager.GetTags();
if
(listOfAllTags.Count > 0)
{
// get last tag. This is redundant - just for demonstration
Telerik.Cms.Engine.ITag lastTag = contentManager.GetTag(((Telerik.Cms.Engine.ITag)listOfAllTags[4]).ID);
// delete the tag by specifying its ID
contentManager.DeleteTag(lastTag.ID);
}
See Also
Overview of Generic Content API
Important Interfaces of Generic Content Module
Content Items Overview
Creating Content Items
Finding Content Items
Modifying Content Items
Deleting Content Items
Comments Overview
Creating Comments
Finding Comments
Modifying Comments
Deleting Comments
Managing Read Status of Comments
Categories Overview
Creating Categories
Finding Categories
Modifying Categories
Deleting Categories
Tags Overview
Creating Tags
Finding Tags
Modifying Tags
not -included