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

Forums / Developing with Sitefinity / Getting back to a previous page | backLink

Getting back to a previous page | backLink

3 posts, 0 answered
  1. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    25 Nov 2009
    Link to this post
    Hi Guys.

    How would I go about adding a "back" link or "previous page" link from my NewsDetail page, back to the NewList page I came from?

    I see in the ListPageMaster.ascx there is a control with the following in it:

    <asp:HyperLink ID="backLink" runat="server" Text="<%$Resources:GoBack %>"></asp:HyperLink>

    I have tried using this on the ListPageDetails.ascx page but it fails.

    If you could help, I would appreciate it!

    Thanks,
    James
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    26 Nov 2009
    Link to this post
    Hi James,

    The back link is visible in ListPageDetail mode, so you should be able to use it without any additional customizations. Please check the attached screenshot. There is the following control declaration:

    <asp:HyperLink ID="backToList1" Text="<%$Resources:AllNews %>" CssClass="sf_back" runat="server"></asp:HyperLink>

    However you can create a custom link and get the previous page using UrlReferrer - Gets information about the URL of the client's previous request that linked to the current URL

    public void Page_Load(object sender, EventArgs e)
    {
        this.HyperLink1.NavigateUrl = Request.UrlReferrer.ToString();
    }


    All the best,
    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.
  3. James@Nw
    James@Nw avatar
    265 posts
    Registered:
    05 May 2009
    26 Nov 2009
    Link to this post
    Thanks Ivan, I will most certainly use this!

    Cheers,
    James
Register for webinar
3 posts, 0 answered