Working with selectors(WebEditors) part 3. Blog selector and Newsletters group selector.

Working with selectors(WebEditors) part 3. Blog selector and Newsletters group selector.

February 13, 2009 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

1. Blog selector( web editor)

This web editor is useful if you want to select some of the blogs you have already created.


Here we are creating an user control where we add BlogPosts control.


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebEditor.ascx.cs" Inherits="CustomControls_WebEditor" %> 
<%@ Register Assembly="Telerik.Blogs" Namespace="Telerik.Blogs.WebControls" TagPrefix="blogs" %> 
<blogs:BlogPosts ID="BlogPosts1" runat="server" ParentIDs="" />


We put the WebEditor in the code behind and use the value to show our blog. Under methods

region you can create a new instance of BlogManager and pass the ID of the WebEditor.


using System;
using System.Web.UI;
using Telerik.Cms.Web.UI;
using System.ComponentModel;
using Telerik.Rss;
using Telerik.Framework.Web.Design;
using Telerik.Cms.Engine;
using Telerik.Cms;
using Telerik.Blogs;
public partial class CustomControls_WebEditor : System.Web.UI.UserControl, ITextControl
    #region Methoods
 protected void Page_Load(object sender, EventArgs e)
 if (selectedBlogs != null)
            BlogManager ctman = new BlogManager();
            IBlog blog = ctman.GetBlog(selectedBlogs[0]);
            BlogPosts1.ParentIDs = selectedBlogs;
    #region Properties
    [TypeConverter("Telerik.Blogs.WebControls.SelectedBlogsConverter, Telerik.Blogs")]
    [WebEditor("Telerik.Blogs.WebControls.BlogsSelector, Telerik.Blogs")]
 public Guid[] SelectedBlogs
 return this.selectedBlogs;
 this.selectedBlogs = value;
 private Guid[] selectedBlogs;







As a result a Guid is returned.


2.Newsletters group selector - it returns all newsletter groups you have already created.


[WebEditor("Telerik.Notifications.Newsletters.WebControl.GroupSelectionList, Telerik.Notifications")]
    [TypeConverter("Telerik.Framework.Utilities.GuidArrayConverter, Telerik.Framework")]
 public Guid[] SubscriberGroups
 get { return subscriberGroups; }
 set { subscriberGroups = value; }
 private Guid[] subscriberGroups;




As a result a Guid is returned.


The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments are disabled in preview mode.
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

More From Progress
ProgressNEXT: Premier Event for Modern Application Development
Read More
Seven Reasons to Check Out Sitefinity 11.1
Read More
Getting Started with Your Omnichannel Content Strategy
Read More