Updating a Blog is a very simple process:
- Get a Blog associated with a transaction
- Change its properties
- Save the Blog with BlogManager
Save a specified blog item:
| SaveBlog(IBlog blog) |
Copy Code |
|
// create new instance of BlogManager Telerik.Blogs.BlogManager blogManager = new Telerik.Blogs.BlogManager(); // get all blogs IList
listOfAllBlogs = blogManager.GetBlogs(); if (listOfAllBlogs.Count > 0)
{
// get the first blog item
Telerik.Blogs.IBlog firstBlog = blogManager.GetBlog(((Telerik.Blogs.IBlog)listOfAllBlogs[0]).ID);
// change Name property of the blog item firstBlog
firstBlog.Name = "Changed Name of First Blog";
// save the item in the database
blogManager.SaveBlog(firstBlog);
Response.Write(firstBlog.Name + "<br />");
}
|
See Also