ResolveMacros in ascx layout

Vaha C asked on December 6, 2017 08:37

I'm trying to resolve macro in ascx layout

<%# CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros("{$=43245325325|de-de=gfdgfdgfdgdfgdf$}") %>

but i'm receiving next error message

[Error loading the layout] http://server/CMSVirtualFiles/Templates/Shared/=vg=1cc48861-6ea1-4a7b-8050-a1dee3318f42/Root_2016.ascx(13): error CS0234: The type or namespace name 'CMSContext' does not exist in the namespace 'CMS.CMSHelper' (are you missing an assembly reference?)

How to fix this error?

Correct Answer

Mariia Hrytsai answered on December 6, 2017 10:28

You can try CMS.MacroEngine.MacroContext.CurrentResolver.ResolveMacros

3 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.