Modify forum posts

To modify a post, you must perform the following:

  1. Get an instance of the manager.
    Get an instance of the ForumsManager object.
  2. Get the specified post.
    Get an instance of the post. For more information, read For developers: Query forum posts.
  3. Modify the instance of the post.
    Update the values of the properties of the post.
  4. Save the changes.
    Save the changes to the manager.

Here is a code example:

C#
using System;
using Telerik.Sitefinity.Forums;
using Telerik.Sitefinity.Forums.Model;

namespace SitefinityWebApp
{
    public class ModifyForumPosts_ModifyPost
    {
        public static void ModifyPost(Guid postId, string newContent)
        {
            ForumsManager forumsManager = ForumsManager.GetManager();

            ForumPost post = forumsManager.GetPost(postId);
            post.Content = newContent;

            forumsManager.SaveChanges();
        }
    }
}
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
New to Sitefinity?