Check if in backend/ admin because shape not found in backend error

Topics: Core, General, Writing modules
Jul 9, 2012 at 7:25 PM

Is there a nice way to check if current request is a admin/backend page?

This because I dynamically add a shape which is only included in the main theme but it's also trying to resolve it in the backend. It's returning an error because it can't find the view.

Coordinator
Jul 9, 2012 at 7:33 PM

The recommended way is to use Orchard.UI.Admin.AdminFilter.IsApplied(RequestContext). You can find usages all over the source code.