Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, i use CMS Umbraco for work and i want to create an Partial View. I have the necessary files in AppPlugin directory and i defined my Partial view in Views/MacroPartials path with name "Prova.chtml". The file contains the following source code:
@inherits Umbraco.Web.Macros.PartialViewMacroPage @using Umbraco.Web; @using eice.framework.Areas.Framework.Controllers;
@Html.Action("Init", "Prova", new { area = "[myRootFolder]", macroParameters = Model.MacroParameters })
but running it i get the following error:
Error loading Partial View script (file: ~/Views/MacroPartials/Prova.cshtml)
and the Exception "NullReferenceException: Object reference not set to an instance of an object".
Why it? How can i solve the problem?
Hi Mario
I think Model.MacroParameters is null in your view.
Model.MacroParameters
Read more how to create macro partial view here - https://our.umbraco.com/documentation/Reference/Templating/Macros/Partial-View-Macros/
Thanks,
Alex
Hi Alex, thanks for the reply. I don't think Model.MacroParameters is null because for other partial views the problem does not occour.
The exception return the following message (view image)
Help me! Thanks, Bye!
Mario
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Error loading Partial View script - Umbraco CMS
Hi, i use CMS Umbraco for work and i want to create an Partial View. I have the necessary files in AppPlugin directory and i defined my Partial view in Views/MacroPartials path with name "Prova.chtml". The file contains the following source code:
@inherits Umbraco.Web.Macros.PartialViewMacroPage @using Umbraco.Web; @using eice.framework.Areas.Framework.Controllers;
@Html.Action("Init", "Prova", new { area = "[myRootFolder]", macroParameters = Model.MacroParameters })
but running it i get the following error:
Error loading Partial View script (file: ~/Views/MacroPartials/Prova.cshtml)
and the Exception "NullReferenceException: Object reference not set to an instance of an object".
Why it? How can i solve the problem?
Hi Mario
I think
Model.MacroParameters
is null in your view.Read more how to create macro partial view here - https://our.umbraco.com/documentation/Reference/Templating/Macros/Partial-View-Macros/
Thanks,
Alex
Hi Alex, thanks for the reply. I don't think Model.MacroParameters is null because for other partial views the problem does not occour.
The exception return the following message (view image)
Help me! Thanks, Bye!
Mario
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.