Copied to clipboard

Flag this post as spam?

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


  • Hayden Tomas 11 posts 82 karma points
    Jan 31, 2019 @ 09:11
    Hayden Tomas
    1

    Formulate runtime error when rendering

    Hi

    I am having an issue rendering a formulate form on the front end of my website, its just a playground at the moment whilst I am learning Umbraco.

    So after following all the instructions to create a form, a layout and a configuration (i chose plain javascript)

    I then went on to render a form via the partial in my master template. I chose the responsive plain javascript partial.

    On the front end, I am met with a runtime error

    The specified Formulate view could not be located on the file system. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: formulate.core.Exceptions.ViewNotFoundException: The specified Formulate view could not be located on the file system.

    Source Error:

    Line 3: @{ Line 4: var viewPath = Model.TemplatePath; Line 5: FileUtility.ValidateView(viewPath); Line 6: } Line 7: @Html.Partial(viewPath, Model)

    Source File: C:\Domains\118929\hayden.one\wwwroot\Views\Partials\Formulate\RenderForm.cshtml Line: 5

    I am new to razor and umbraco but so far have managed to port a html template in and even get a menu working, this would be the last piece of the puzzle for a basic website!

    Thanks

    Hayden

  • Rhys Hamilton 140 posts 942 karma points
    Jan 31, 2019 @ 13:54
    Rhys Hamilton
    0

    I think the problem here is that the viewPath property isn't returning a valid string (with appropriate formatting).

    Since we know that your view is located within \Views\Partials\Formulate\ you could just use the following line instead:

    var viewPath = "~/Views/Partials/Formulate/RenderForm.cshtml";
    
  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Jan 31, 2019 @ 17:31
    Nicholas Westby
    0

    A few things to try:

    • Ensure you've picked both the layout and template from the configured form.
    • Ensure you've picked your configured form from your form picker property on your content node.
    • Ensure your code refers to the same property alias that exists on your content node.
    • Set the debugger. See if viewPath is null. If not, confirm that the file it's referring to exists.
    • If you installed Umbraco as subapplication (uncommon), weird things may happen.
  • Hayden Tomas 11 posts 82 karma points
    Jan 31, 2019 @ 20:05
    Hayden Tomas
    0

    Thank you

    I did manage to finally get it working. Or at least rendering on the front end!

    It was a case of looking at the read me at taking it one byte at a time until finally it showed through, took a good day to get there but i managed it. I do have an smtp question as that is not working but I will add that in a new thread!

  • BJ Patel 80 posts 206 karma points
    Sep 24, 2020 @ 13:19
    BJ Patel
    0

    Hi Hayden,

    If possible can you please share how you managed it ?

    Thanks

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 25, 2020 @ 23:00
    Nicholas Westby
    1

    Follow up for anybody who is curious...

    I think this error usually means you haven't chosen a configured form, or you are referencing the wrong property name, or the configured form is missing something (such as a selected template or a selected layout), or the layout is missing a selected form. So probably content entry, essentially.

Please Sign in or register to post replies

Write your reply to:

Draft