More in this section

ItemId / url

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Clyde
    Clyde avatar
    15 posts
    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
    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> 

    Do let us know if you need any further assistance.

    Best wishes,
    the Telerik team

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