I need to put some script into an if-sentence on a razor masterpage ("if cookie level option = all") But I can't make it work as cshtml.
I hope some of you will make a copy of the code snippet and put it here - thanks in advance!!
/LTP
I need to put some script into an if-sentence on a razor masterpage ("if cookie level option = all") But I can't make it work as cshtml.
I hope some of you will make a copy of the code snippet and put it here - thanks in advance!!
/LTP
Like this:
if(Dynamicweb.Environment.CookieManager.GetCookieOptInLevel() = Dynamicweb.Environment.CookieOptInLevel.All){ //Option is all }
Someting like this :
@if (GetGlobalValue("Global:Area.ID") == 'All') { //Stuff }
Thank you - I tried both versions. Forgot to tell, that I am working with a wrap-solution. Should that make a difference? Perhaps a totally other way of doing it?
Here is my code in the head of the master.cshtml:
@if(Dynamicweb.Environment.CookieManager.GetCookieOptInLevel() = Dynamicweb.Environment.CookieOptInLevel.All){
@GetValue("Item.Area.OtherAnalyticsCode")
}
And the error - regarding another template:
Error compiling template "Designs/Dwsimple/_parsed/fullwidth.parsed.cshtml" Line 1939: The left-hand side of an assignment must be a variable, property or indexer
/Lise
@if(Dynamicweb.Environment.CookieManager.GetCookieOptInLevel() == Dynamicweb.Environment.CookieOptInLevel.All){
@GetValue("Item.Area.OtherAnalyticsCode")
}
Woops...
You must be logged in to post in the forum