More in this section

Forums / Developing with Sitefinity / ItemViewUrl property

ItemViewUrl property

5 posts, 1 answered
  1. Sandip
    Sandip avatar
    9 posts
    Registered:
    27 Dec 2008
    14 Oct 2009
    Link to this post
    Hi,

    I am trying to reuse the templates for Admin controls for new module and need to define this property for client side binding.

    ((currentUserControl)Parent.Parent).ItemViewUrl


    I believe it needs to be defined in controlpanel class, what should URL it should return and how can I implement it.

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Oct 2009
    Link to this post
    Hi Sandip,

    As I see it you are trying to add NavigateUrl to some link or an href. Sample code:

    <telerik:ClientTemplate Name="View" runat="server">
                <a href="<%= ((Telerik.Samples.Controls.Admin.AllItemsListView)Parent.Parent).ItemViewUrl %>">{#MetaFields.Price#}</a>
    </telerik:ClientTemplate>

    In your view you should have defined ItemViewUrl

    Sample code:

    public class AllItemsListView : ContentItemsList<ListView>
    {
     
    ....
     
            /// <summary>
            /// Gets the item view URL.
            /// </summary>
            /// <value>The item view URL.</value>
            public override string ItemViewUrl
            {
                get
                {
                    if (this.itemViewUrl == null)
                        this.itemViewUrl = CreateHostViewCommand<ListItemView>("{#ID#}");
                    return this.itemViewUrl;
                }
            }
     
     
    ....
     
    }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  3. Sandip
    Sandip avatar
    9 posts
    Registered:
    27 Dec 2008
    14 Oct 2009
    Link to this post
    Thanks Ivan....that helps !!!
  4. Sandip
    Sandip avatar
    9 posts
    Registered:
    27 Dec 2008
    14 Oct 2009
    Link to this post
    CreateHostViewCommand<ListItemView>("{#ID#}");

    What is the ListItemView ?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Oct 2009
    Link to this post
    Hi Sandip,


    ItemViewUrl is a property of the view that we are accessing. CreateHostViewCommand will return you a command url which you can use then to assign it to the NavigateUrl property of the HyperLink.  By doing so we receive this parameter on View to which we navigate ListItemView.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
5 posts, 1 answered