Page view counter

How does your code know if you're in preview mode?

Rate It (1)

Last post 09-25-2005 11:32 AM by jjohns09. 3 replies.

Sort Posts:

  • How does your code know if you're in preview mode?

    09-22-2005, 11:03 PM
    • Loading...
    • DeveloperMCDBA
    • Joined on 05-08-2005, 8:08 AM
    • Deltona, FL, USA
    • Posts 1,114
    • Points 5,570
    ok, you're logged in as an admin. There's a preview button on the control panel. If you were going to write some code to do something based on if its in preview mode, what is it that you have to evaluate?

    Thanks!

    Darren
  • Re: How does your code know if you're in preview mode?

    09-23-2005, 12:22 AM
    • Loading...
    • ecktwo
    • Joined on 02-18-2003, 11:51 PM
    • Posts 564
    • Points 2,830
    It's in the cookie:

          If Not Request.Cookies("_Tab_Admin_Preview" & PortalSettings.PortalId.ToString) Is Nothing Then
               chkPreview.Checked = Boolean.Parse(Request.Cookies("_Tab_Admin_Preview" & PortalSettings.PortalId.ToString).Value)
          End If
  • Re: How does your code know if you're in preview mode?

    09-24-2005, 3:44 AM
    • Loading...
    • DeveloperMCDBA
    • Joined on 05-08-2005, 8:08 AM
    • Deltona, FL, USA
    • Posts 1,114
    • Points 5,570
    thanks ecktwo!
  • Re: How does your code know if you're in preview mode?

    09-25-2005, 11:32 AM
    • Loading...
    • jjohns09
    • Joined on 06-22-2002, 1:58 PM
    • Overland Park, Kansas
    • Posts 320
    • Points 1,610
    Additionally, IsEditable will be false when when in preview mode.

    Jeff
    http://www.bestmodules.com - Modules, Skins & Skin Objects
Page 1 of 1 (4 items)