i'm using umbraco 4.5, i need to do a .net inline Response.Redirect in a template. i have a macro that return a string which is an URL. the Response.Redirect will pick up that URL string and work upon it.
my current problem is, i can't call the macro using .net code, here is what i have so far.
the above line used to work in umbraco 4.0 but in 4.5 it stopped working. it can be as easy as some syntax change on that line but i can't seem to figure it out.
any comment/suggestion/advice will be utmost appreciated! please help
i translate what you suggested as: lImgUri = umbraco.library.RenderMacroContent(DirectCast("<umbraco:Macro Alias='FilmMediaImage' macroAlias='FilmMediaImage' runat='server' />", String), lPageId)
and it's still not working. could you please paste me the line where you apply the macro into, the part where you add <umbraco:macro.... />
how to call a macro in a template using .net
i'm using umbraco 4.5, i need to do a .net inline Response.Redirect in a template. i have a macro that return a string which is an URL. the Response.Redirect will pick up that URL string and work upon it.
my current problem is, i can't call the macro using .net code, here is what i have so far.
<%
lImgUri = umbraco.library.RenderMacroContent("<umbraco:Macro Alias="" macroAlias=""FilmMediaImage"" runat=""server""></umbraco:Macro>", lPageId)
%>
the above line used to work in umbraco 4.0 but in 4.5 it stopped working. it can be as easy as some syntax change on that line but i can't seem to figure it out.
any comment/suggestion/advice will be utmost appreciated! please help
I've never done it like that. I normally use an extension method.
Try this:
Update: this is actually what I use to render a macro which is in a WYSIWYG.
i translate what you suggested as:
lImgUri = umbraco.library.RenderMacroContent(DirectCast("<umbraco:Macro Alias='FilmMediaImage' macroAlias='FilmMediaImage' runat='server' />", String), lPageId)
and it's still not working.
could you please paste me the line where you apply the macro into, the part where you add <umbraco:macro.... />
thanks!
is working on a reply...