1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / RssContentSelector

RssContentSelector

4 posts, 0 answered
  1. Nick
    Nick avatar
    14 posts
    Registered:
    30 Jun 2006
    28 Sep 2007
    Link to this post
    I am trying to implement the RssContentSelector but keep getting the error unable to cast system.Guid to System.Guid[].  Does anyone know how this should be implemented as i am clearly doing something wrong.  At present my code looks like this below, thanks

    private Guid rssUrl;

    [WebEditor("Telerik.Cms.Engine.WebControls.RssContentSelector, Telerik.Cms.Engine")]

    public Guid RssUrl

    {

    set

    {

    rssUrl = value;

    }

    get

    {

    return rssUrl;

    }

    }

  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    28 Sep 2007
    Link to this post
    Hi Nick,

    To use RssContentSelector, your property should be of type Guid[] i. e. should be an array of Guids.

    [WebEditor("Telerik.Cms.Engine.WebControls.RssContentSelector, Telerik.Cms.Engine")] 
            public Guid[] RssUrl 
            { 
                get 
                { 
                    return this.rssUrl; 
                } 
                set 
                { 
                    this.rssUrlvalue
                } 
            } 
     
    private Guid[] rssUrl; 

    Hope this helps.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Nick
    Nick avatar
    14 posts
    Registered:
    30 Jun 2006
    28 Sep 2007
    Link to this post
    Hi Pepi,

    Thanks for the reply, although i had already tried that which gave me the following error.  Any ideas?



    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Cms.Web.UI.PropertyEditorDialog.GetEditor() +478
       Telerik.Cms.Web.UI.PropertyEditorDialog.CreateChildControls() +155
       System.Web.UI.Control.EnsureChildControls() +87
       Telerik.Cms.Web.UI.PropertyView.picker_Command(Object sender, CommandEventArgs e) +284
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +105
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +132
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.1378; ASP.NET Version:2.0.50727.1378
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    01 Oct 2007
    Link to this post
    Hello Nick,

    This exception is caused by the fact that Type Container (the control containing RssUrl property) requires implementation for FeedProviderName dependent property. After adding this property another exception will be thrown up because RssContentSelector control always tries to cast the Type Container to RssContent type. So you could create a custom control that inherits RssContent or you could use RssContent directly.

    Also in Sitefinity 3.1 RssContent is marked as obsolete because we have a new Rss implementation. So I would suggest you to use our new Rss API instead of the old one. The class that you need is Telerik.Rss.WebControls.RssFeedSelector, located in Telerik.Rss assembly. You could manage Rss Feeds from Administration->Services->Rss Feeds. It is my mistake that I didn't inform you about this in my previous post.

    [WebEditor("Telerik.Rss.WebControls.RssFeedSelector, Telerik.Rss")] 
            public string RssUrl 
            { 
                get 
                { 
                    return this.rssUrl; 
                } 
                set 
                { 
                    this.rssUrl = value
                } 
            } 
     
            private string rssUrl; 

    Don't hesitate to contact us if you need any further assistance.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered