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

Forums / Developing with Sitefinity / NewsView BehaviorMode

NewsView BehaviorMode

2 posts, 1 answered
  1. Bruno Michels
    Bruno Michels avatar
    125 posts
    Registered:
    16 Apr 2010
    14 Jun 2010
    Link to this post
    How can I force the BehaviorMode to be Detail ?

    public class NewsContent: Telerik.News.WebControls.NewsView
    {
        public override Telerik.Cms.Engine.WebControls.ContentView.BehaviorModes BehaviorMode
        {
            get
            {
                return BehaviorModes.Detail;
            }
            set
            {
                base.BehaviorMode = BehaviorModes.Detail;
            }
        }
        //...
    }

    It shows the behavior as Detail but the page displays

    Server Error in '/' Application.
    The resource cannot be found.

    Without the override and setting manually it works.

    How can I force the BehaviorMode to Detail?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    14 Jun 2010
    Link to this post
    Hi Bruno Michels,

    Set the mode explicitly or return the value of BehviorMode property  in CreateChildControls before calling the base.

    ected override void CreateChildControls()
        {
                            
            this.BehaviorMode = BehaviorModes.Detail;
            base.CreateChildControls();
        }

    The Details mode is used when you want to show a single item, s you should set the id of an item or you should have another NewsView control that adds the item ID to the QueryString.

    The control uses url rewriting and Rource cannot be found. means that you have not set item to display or te url to the item is not correct.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
2 posts, 1 answered