Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nguyen Dung Tri 106 posts 605 karma points
    Aug 08, 2016 @ 18:43
    Nguyen Dung Tri
    1

    Is there a way to detect being in Back-End or Front-End of Umbraco Site?

    Hello,

    Is there is a code in C# or Javascript that can detect where user is view on Back-End or Front-End of Umbraco Site?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Aug 08, 2016 @ 20:00
    Alex Skrypnyk
    100

    Hi Nguyen,

    As I understand right, it's easy to do with UmbracoContext.IsFrontEndUmbracoRequest flag;

    UmbracoContext.IsFrontEndUmbracoRequest
    

    Thanks,

    Alex

  • Nguyen Dung Tri 106 posts 605 karma points
    Aug 12, 2016 @ 04:07
    Nguyen Dung Tri
    1

    Hi Alex,

    To access none-static member. We should use this:

    UmbracoContext.Current.IsFrontEndUmbracoRequest
    
  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Aug 12, 2016 @ 09:01
    Alex Skrypnyk
    0

    Thanks Nguyen, nice tip!

  • Ayo Adesina 419 posts 1001 karma points
    Dec 02, 2020 @ 15:38
    Ayo Adesina
    0

    I have a problem with the value being returned by UmbracoContext.Current.IsFrontEndUmbracoRequest

    If UmbracoContext.Current.IsFrontEndUmbracoRequest is giving me false... when it should give me true (its a page that is in the front end of the website) has anyone got any idea why I that value is false?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies