Copied to clipboard

Flag this post as spam?

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


  • Garrett Fisher 341 posts 496 karma points
    Oct 19, 2016 @ 17:42
    Garrett Fisher
    0

    Cshtml File Not Listed In "Partial View Files On Server"

    Hi,

    Well my topic title pretty much says it all on this one. I've got a CSHTML file in my /Views/MacroPartials folder, for sure it's there, but when creating a Macro to use it, the file does not appear in the "Partial View Files On Server" dropdown in the Macro settings page. So I just typed it in, thinking this might just be a small, ignorable weirdsie. But now, when loading the page whose template calls this macro on the front end, I get this error:

    Error loading Partial View script (file: ~/Views/MacroPartials/MyNewMacro.cshtml) 
    

    What could this be? Why is my CSHTML file not seen and not in the list of choosable files?

    Thanks,

    Garrett

  • Garrett Fisher 341 posts 496 karma points
    Oct 19, 2016 @ 18:23
    Garrett Fisher
    0

    Can anyone please offer some counsel on this issue? This is the basic settings remote javascript import writer and without it, I cannot move forward with the rest of the implementation of this project.

    //Garrett

  • Dennis Adolfi 1082 posts 6449 karma points MVP 6x c-trib
    Oct 20, 2016 @ 06:26
    Dennis Adolfi
    1

    Hi Garrett.

    I cant really say why your partial is not beeing shown in your list of partials when you are creating your macro, but maybe this can fix it:

    Try to create a new macro partial by right clicking on the "Partial View Macro Files" folder and select create. Create a empty partial view and make sure to leave the checkbox "Create macro" ticked. That way you will get a macro created automaticly. Try to render that macro on your site and see if that works. If it works, copy/paste your code from the old "non-showing" macro-partial into the new one and then remove the old one.

    If it does´nt work and you still get an error, check the error log for any entry marked ERROR. The error message you pasted in your thread is just a generic error message and hard to tell what´s the problem.

    Let me know if any of this suggestions helped.

    Best of luck to you Garrett!

  • Garrett Fisher 341 posts 496 karma points
    Oct 20, 2016 @ 10:33
    Garrett Fisher
    0

    Thanks for replying, Dennis :)

    When I create under "Partial View Macro Files" in the CMS UI, no physical file is created and I ended up in the same situation. Basically, I got this project from Git and that file in question, which I was originally talking about. was just there and I didn't create that in the UI. So I guess Umbraco doesn't list these files based on a directory scan? What else can I do?

    I don't see anything in the Windows Application event log but I'm not sure this is where I should be looking. However, it seems clear to me that the error is that it can't find the file, based on the logic that the file isn't in the selection list.

    //Garrett

Please Sign in or register to post replies

Write your reply to:

Draft