Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mario 3 posts 73 karma points
    Feb 25, 2019 @ 15:45
    Mario
    0

    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?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 25, 2019 @ 16:20
    Alex Skrypnyk
    0

    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

  • Mario 3 posts 73 karma points
    Feb 26, 2019 @ 08:23
    Mario
    0

    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) enter image description here

    Help me! Thanks, Bye!

    Mario

Please Sign in or register to post replies

Write your reply to:

Draft