and the second one is an HttpException at line 8 in \Views\MacroPartials\RenderUmbracoFormScripts.cshtml
Html.RenderAction("Render", "UmbracoForms", new { formId = form, mode = "script"});
What I have found to be the offending code (I might be wrong) is this line at the bottom of my Master template:
@Umbraco.RenderMacro("FormsRenderScripts")
which was inserted during the fourth video "Preparing your frontend". I have also noticed that inserting this with the Insert Macro function (button) in 7.2.8 does not insert identical code to that in the video. In the video, the line looks like this:
Well, that is how it is coded in the actual document template where the form is. This code is inserted automatically with the Insert Macro function (button) in the backend, as shown in the video "Adding forms to your templates". Allthough, there is also a slight difference in the code from the video, but I guess that has something to do with version. And the form seems to work fine, actually:-) (It gives me an error when trying to send an e-mail as part of the workflow, but that's probably my setup and local hosting.)
However, in the previous video "Preparing your frontend", one inserts an other macro at the bottom of the Master template, and this is what causes the problem in question.
But maybe this just isn't needed anymore in the new version? (As I said, the form appears to work.)
Adding a form
I have tried to follow the series of videos on Umbraco.tv about Umbraco forms. I'm currently on Version 7.2.8, and using the Fanoe starter kit.
Everything seemed fine until I actually inserted a form on a content page. The site now chokes in Visual Studio with a couple of exceptions:
The first one is an HttpCompileException at line 140 in \Views\Partials\Forms\Form.cshtml
and the second one is an HttpException at line 8 in \Views\MacroPartials\RenderUmbracoFormScripts.cshtml
What I have found to be the offending code (I might be wrong) is this line at the bottom of my Master template:
which was inserted during the fourth video "Preparing your frontend". I have also noticed that inserting this with the Insert Macro function (button) in 7.2.8 does not insert identical code to that in the video. In the video, the line looks like this:
And if I change the code to this, the exceptions go away. However, I am now seeing some strange markup rendered at the bottom of the page:
Any ideas on what I am doing wrong?
Have you tried
@Html.Action("Render", "UmbracoForms", new { formId = form, mode = "script" });
Obviously it all depends on your parameters names etc?
This assumes you have a controller called "UmbracoForms" that has an action "Render" and accepts two parameters.
Hi Bendik,
What if you are adding the form with something like this:
Will this work? Remember to change the GUID of the form, so it match yours.
You can find the GUID in the url, when you are on the form in the Umbraco backoffice.
Hope this helps,
/Dennis
Hi Dennis,
Well, that is how it is coded in the actual document template where the form is. This code is inserted automatically with the Insert Macro function (button) in the backend, as shown in the video "Adding forms to your templates". Allthough, there is also a slight difference in the code from the video, but I guess that has something to do with version. And the form seems to work fine, actually:-) (It gives me an error when trying to send an e-mail as part of the workflow, but that's probably my setup and local hosting.)
However, in the previous video "Preparing your frontend", one inserts an other macro at the bottom of the Master template, and this is what causes the problem in question.
But maybe this just isn't needed anymore in the new version? (As I said, the form appears to work.)
Bendik
sorry Bendik,
I misread your email while working on something else....oppppsss!!!!
is working on a reply...