Getting Macro parameter in razor when macro has been called programatically
Hi there
I need to add some macro(.net usercontrols) programatically using a repeater... So I am doing the following in my .Net control:
int ProductFolderID = 1188;
umbraco.presentation.templateControls.Macro mcr = new umbraco.presentation.templateControls.Macro();
mcr.Alias="SiteDocumentULList";
mcr.MacroAttributes.Add("source",ProductFolderID);
mcr.MacroAttributes.Add("documenttypealias", "1079");
this.macroContainer.Controls.Add(mcr);
I am passing 2 attributes along with my macro...
however when retrieving the parameter in razor give me nothing: // Get parameter from umbraco var pageID = @Parameter.source; var docTypeAlias= @Parameter.documenttypealias;
Getting Macro parameter in razor when macro has been called programatically
Hi there
I need to add some macro(.net usercontrols) programatically using a repeater... So I am doing the following in my .Net control:
int ProductFolderID = 1188;
umbraco.presentation.templateControls.Macro mcr = new umbraco.presentation.templateControls.Macro();
mcr.Alias="SiteDocumentULList";
mcr.MacroAttributes.Add("source",ProductFolderID);
mcr.MacroAttributes.Add("documenttypealias", "1079");
this.macroContainer.Controls.Add(mcr);
I am passing 2 attributes along with my macro...
however when retrieving the parameter in razor give me nothing:
// Get parameter from umbraco
var pageID = @Parameter.source;
var docTypeAlias= @Parameter.documenttypealias;
both are empty...
Is there a way of doing that...
Thanks for any help
is working on a reply...