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

ItemId / url

2 posts, 0 answered
  1. Clyde
    Clyde avatar
    15 posts
    Registered:
    02 May 2008
    27 Sep 2008
    Link to this post
    Where can I find a good description of the logic and access methods to use the selected item id and it's relationship to the url?

    When I am on the detail page of a content view for example I need to be able to access the itemId (parsed from the URL or stored somehere on the session?) and then link to the next page using the same logic. The challenge is that I am doing this from a control which is not based upon ContentView (because I don't want the content field).
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    29 Sep 2008
    Link to this post
    Hello Clyde,

    ContentView control has a property SelectedItemId. It returns the ID of the currently selected item. Then, you could use GetContent(Guid id) method in order to get the content item which represents an IContent object. IContent interface provides a property (Url) that gets/sets the url of the item.

    Note that if you don't want to display the content of the item, you could set Visible="false" for the control with ID "content" in the ~/Sitefinity/ControlTemplates/Generic_Content/ContentViewSingleItem.ascx template:

    <asp:Panel ID="pnlContent" runat="server" CssClass="sf_genericContent"
        <asp:Literal ID="content" runat="server" Visible="false"></asp:Literal> 
    </asp:Panel> 

    Do let us know if you need any further assistance.

    Best wishes,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered