Developer forum

Forum » Development » Is Backend or Frontend - PAgeTemplate extender

Is Backend or Frontend - PAgeTemplate extender


Reply
Hello.

I thought that a PageTemplateExtender only would be executed on the frontend, but i found out that it is executed in the backend as well. 

Anyway, it would be good practice, when creating a PageTemplateExtender, to check if you are on the frontend or backend. Is there any easy way to do this i with the API?

Replies

 
Reply

You could check if Dynamicweb.Frontend.PageView.Current() is null.

Another option is to check the current Environment...
Dynamicweb.Permissions.Security.Environment.IsFrontEnd()

Dynamicweb.Permissions.Security.Environment.IsInBackend()


/Morten

 

You must be logged in to post in the forum