Developer forum

Forum » Development » PageLoad event - affects Admin

PageLoad event - affects Admin

Dmitrij Jazel
Reply

Hi guys,

I recently implemented a PageLoad event, with some logic that affects Front-end in my event.

Got into situation that changes are applyed to whomever is in Admin, and attempts to see paragraph or do whatever in backend.

 

Question:

Can I somehow isolate PageLoad event,`add some conditional arround my implementation, and make sure that it will execute only if I am in Front-end?

Would be great if I could somehow detect that I am in /Admin? or any other way?

Suggestions?

/Dmitrij


Replies

 
Mikkel Høst
Reply

Hi Dmitrij.

You can use "Dynamicweb.ExecutingContext.IsBackend()" or "Dynamicweb.ExecutingContext.IsFrontend"

 
Nicolai Høeg Pedersen
Reply

As I wrote in a previous post on this subject with you, you could use if(Dynamicweb.ExecutingContext.IsFrontEnd()){}

 
Dmitrij Jazel
Reply

Hi Mikkel and Nicolai, Thanks for suggestions,

I wanted to try Nicolais suggestion, but wanted to be sure, and possibly hear more than one option.

Therefore decided to create a forum post.

 

Will try it now, and will let you guys know how it went, Thanks for quick answer! :-)

/Dmitrij

 

You must be logged in to post in the forum