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

Forums / Developing with Sitefinity / Geting last page

Geting last page

3 posts, 0 answered
  1. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    13 Jan 2009
    Link to this post
    Morning everyone,

    I have a scenario (specifically a checkout type scenario) where i need to check the last page the user was on and make sure that the request for the current page comes from this page.

    For example i have:

    review  > checkout > confirmation

    if a user access confirmation from any other page but checkout i need to perform certain actions. Does the api provide a way of knowing what the last page was?

    Thanks,

    Duncan
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    13 Jan 2009
    Link to this post
    I'm not sure if this is what you're looking for, but the Page.Request variable has a UrlReferrer property:

    Page.Request.UrlReferrer.AbsoluteUri

    that contains the previous url of the previously visited page.

    As an alternative, I personally use the session. on the checkout page I set a session variable to true, and check that variable in the confirmation. If it's true I proceed, if it's false (or does not exist because it wasn't set) then I redirect out.

    I hope this was helpful!

  3. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    14 Jan 2009
    Link to this post
    Thanks SelArom,

    I took your advice and built a manager class that sets a session (bool), the class allows me to lock down any page of the CMS until unlocked by the desired process of page flow...

    I generally try not to use sessions as i have run into scenarios with hand me down legacy code that was overload with sessions and not management of them... In a case like this sessions can get dropped out of the collection and this is never a good thing... But in this case it would be a perfect use of a session.

    Duncan
Register for webinar
3 posts, 0 answered