I have a jQuery function capturing the click and want to load that page's data using a macro (via a template) that will format and display the contents of the relevant page.
The reason why you canĀ“t get it to work is because that you are mixing MVC, with the old DynamicNode razor. You need to create a partial view or a partial view macro.
If you are choosing to use a parital view macro, you can again choose between dynamic razor and strongly typed razor, so this code is the same, but in parital view macro you need to inhert from this.
If you should create a parital view you will find the folder under the settings section, and if you go with the parital view macro, you will need to go to the developer section.
Pass child page url to razor macro with jquery
Hi
I have a Razor foreach loop writing something like:
I have a jQuery function capturing the click and want to load that page's data using a macro (via a template) that will format and display the contents of the relevant page.
In the "myTemplate" template:
and in the "MyMacro" macro:
This obviously doesn't work at all!
Hi Robin,
The reason why you canĀ“t get it to work is because that you are mixing MVC, with the old DynamicNode razor. You need to create a partial view or a partial view macro.
http://our.umbraco.org/documentation/reference/templating/Mvc/views
If you are choosing to use a partial view your top of the file should look like this:
In the partial view you can choose to use dynamic razor or strongly typed razor if you are using the dynamic razor it should look like this:
And the strongly typed version looks like this:
If you are choosing to use a parital view macro, you can again choose between dynamic razor and strongly typed razor, so this code is the same, but in parital view macro you need to inhert from this.
Here are some documentation on how to rewrite your old DynamicNode Razor to MVC razor in the bottom of the page. http://our.umbraco.org/documentation/Reference/Templating/Macros/Partial-View-Macros/
If you should create a parital view you will find the folder under the settings section, and if you go with the parital view macro, you will need to go to the developer section.
Hope this helps,
/Dennis
is working on a reply...