Press Ctrl / CMD + C to copy this to your clipboard.
I've created a user control with a true/false property and set it up as a macro on my main template (master page)
I want to be able to set that property to true of false from any page that inherit that template and pass it to the user control at the main template (master page)
How can I receive the value and inject it to the property of my user control ?
You can pass in the property value recursively by replacing the [#myProperty] with [$myProperty]
This will have it find the value by recursing parent nodes and using the first node that has that property set.
<umbraco:Macro MyProperty="[$myPropertyAlias]" Alias="MyMacro" runat="server"></umbraco:Macro>
have a look at the advanced parameter syntax here: http://umbraco.org/documentation/books/macro-parameters-syntax/advanced-parameter-syntax.
Using recursive page values should be what you are looking for. When the .Net control is placed on the master page the actual value will be determined by first by the current page (if the value is set), otherwise by it's parent (if that value is set) and so forth.
Hope that helps,Sascha
Write your reply to:
Image will be uploaded when post is submitted