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
    • Contributor
      5,570 point Contributor
    • DeveloperMCDBA
    • Member since 05-08-2005, 8:08 AM
    • Deltona, FL, USA
    • Posts 1,114
    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
    • Contributor
      2,830 point Contributor
    • ecktwo
    • Member since 02-18-2003, 11:51 PM
    • Posts 564
    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
    • Contributor
      5,570 point Contributor
    • DeveloperMCDBA
    • Member since 05-08-2005, 8:08 AM
    • Deltona, FL, USA
    • Posts 1,114
    thanks ecktwo!
  • Re: How does your code know if you're in preview mode?

    09-25-2005, 11:32 AM
    • Participant
      1,610 point Participant
    • jjohns09
    • Member since 06-22-2002, 1:58 PM
    • Overland Park, Kansas
    • Posts 320
    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)