We have a simple web form to post blog items to a blog in our website pro grammatically. The web form consists of only three fields e-mail, title and content. The e-mail and title are just the normal text boxes and the content field is a normal text area.
As suggested in the developer manual the web form works perfectly fine the post items are created in the specified blog. Below is the code that we have been using.
Telerik.Blogs.BlogManager blogManager = new Telerik.Blogs.BlogManager();
// get all blogs
IList listOfAllBlogs = blogManager.GetBlogs();
if (listOfAllBlogs.Count > 0)
// get the the blog by ID
Telerik.Blogs.IBlog firstBlog = blogManager.GetBlog(BlogId);
// create a blog post by calling the CreateContent method of the
// ContentManager class through the BlogManager class
Telerik.Cms.Engine.IContent postContent = blogManager.Content.CreateContent("text/html");
// set the parent of the post item to be selected Blog
postContent.ParentID = firstBlog.ID;
// save the Content property value and the Title meta key
postContent.Content = _txtContent.Text;
//save the Content item through the BlogManager
But in order to provide better user experience we started implementing the Telerik RadEditor for the content field which was a text area before, so that the users can create links for some of the content they put in.
<telerik:EditorCssFile Value="~/Sitefinity/ControlTemplates/Blogs/EditorCssFile.css" />
The code does create a blog post, but it does not keep the formatting that the user provided for example some links that was created in the content of the form. And we are getting an execption stating that: “Please, use the Content property of RadEditor to set its content. The value of the Text property is generated using the value of the Content property”
Can you please suggest me how I can keep the formatting and also how can I refer the content property of RadEditor in code as I am presently using the IContent interface. Can we still use the IContent interface or do I need to use any other interface.