Using Property from Custom Page Base in Razor Macro
I have created a custom master page base for use with Umbraco, and that is working just fine. I am able to grab properties from the master page using syntax such as:
<h1><%= this.<CustomPropertyName> %></h1>
What I am having trouble with is sending one of those page base properties as a parameter to a Razor macro I have created. It won't allow me to us the same syntax above because I receive a server error stating Server tags cannot contain <% ... %> constructs. I have also tried to access the master page from the CSHTML file, also to no avail.
I would greatly appreciate it if anyone could help lead me in the right direction.
Using Property from Custom Page Base in Razor Macro
I have created a custom master page base for use with Umbraco, and that is working just fine. I am able to grab properties from the master page using syntax such as:
What I am having trouble with is sending one of those page base properties as a parameter to a Razor macro I have created. It won't allow me to us the same syntax above because I receive a server error stating Server tags cannot contain <% ... %> constructs. I have also tried to access the master page from the CSHTML file, also to no avail.
I would greatly appreciate it if anyone could help lead me in the right direction.
Thank you in advance.
Eric
I found a super helpful article online that covers this exact topic. Thanks to Jason at Delphic Sage. I hope this helps some one else!
http://www.delphicsage.com/home/blog.aspx/d=854/title=Code_Expressions_to_Programmaticify_Your_Umbraco_Site
is working on a reply...