Sitefinity CMS

Modifying Forums Posts Send comments on this topic.
See Also
Developing with Sitefinity > Modules > Modules API > Forums > Forum Posts > Modifying Forums Posts

Glossary Item Box

Updating a Post is a very simple process:

  1. Get a Post associated with a transaction
  2. Change its properties
  3. Save the Post with ForumManager
SavePost(IPost post) Copy Code
// get first forum
Telerik.Forums.IForum firstForum = (Telerik.Forums.IForum)listOfForums[0];
// get all posts for this forum with specified ID
IList listOfPosts = forumManager.GetForumThreads(firstForum, false);
// get first post of the list associated with the current transaction
Telerik.Forums.IPost firstRootPost = forumManager.GetPost(((Telerik.Forums.IPost)listOfPosts[0]).ID);
// change title of the post
firstRootPost.Title = "Changed Title of First Root Post";
// save the post
forumManager.SavePost(firstRootPost);
Response.Write(firstRootPost.Title +
"<br />");

 

See Also