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
Can you explain the customisations that are needed to get Formulate to work with WebForms?
I've never tried it, but shouldn't be too hard to get it to work.
I'm assuming you're starting with a page that looks a bit like this: http://www.formulate.rocks/render-form
Replace this line:
With a modified version of this code: https://github.com/rhythmagency/formulate/blob/e2f74581730d72c0bd806616320972128ddfbe43/src/Website/Views/Partials/Formulate/Responsive.Bootstrap.Angular.cshtml
You'll have to make a couple changes. For example, there will no longer be a model, as you won't be in a Razor partial. You can use the "vm" variable instead.
If you want to componentize it, you certainly should be able to toss that code into a user control. You'll just have to make sure you pass the view model to the user control from your page.
Let me know if you need any clarifications.
but you are dealing with a Web Forms dinosaur here, so your explanation was a bit over my head.
I'm in phase I of migrating our site to Umbraco in its current form using Web Forms, and phase II will be to move to MVC.
Having said that, I did manage to get a form working by creating a file called formulateMacro.cshtml in the /Views/MacroPartials folder, and copying and pasting the code in your "render-form" page.
The only change I made was to your second line of code, i.e.
was changed to
At the moment, the template for the page holding the form has only one job, i.e. to act as a placeholder for the formulateMacro macro.
I didn't change anything else, though, so I'm guessing I'll hit a few problems when I attempt to integrate it into my existing page templates.
Although I received an email after submitting the form, I'm still a bit bewildered as to how it all works.
My Umbraco learning curve continues, eh...
It seems that you have converted this Razor view into a partial view macro: http://www.formulate.rocks/render-form
You are correct that you'll run into problems later, as that partial view is now rendering the entirety of your page, including the <html>, <head>, and <body> tags.
Since you are using WebForms with Umbraco, I am assuming that you typically have a file called "MyPage.master" (i.e., a masterpage, which is how Umbraco makes use of WebForms if you are using WebForms rather than Razor views).
Assuming you have MyPage.master, most of the code from here would go in that page: http://www.formulate.rocks/render-form
You've also pointed out an interesting fact. That is, Umbraco supports some interoperability between WebForms and Razor in the form of macros. You can create macros as WebForms user controls, or as Razor partial views. That means you could basically leave Responsive.Bootstrap.Angular.cshtml unchanged (well, some minor changes), so long as you convert it so that it's used as a macro (and then you could render that macro from a masterpage or a razor view).
If you want to go down that road, be mindful that you'll have to somehow coordinate passing data from your MyPage.master to the Responsive.Bootstrap.Angular.cshtml macro, as passing data to macros can be quirky in Umbraco. One way to do that would be to have the macro fetch the picked form off of the current page, but that could in turn cause complications (e.g., if you are storing forms in an Archetype, grid, or nested content rather than directly on a property on the current page).
By the way, let me know if you found particular portions of my above explanation confusing and I'd be happy to dive into details.
I went ahead and created an example repo: https://github.com/Nicholas-Westby/web-formulate
Download it, run the solution, and you'll see a Formulate form rendered just like the screenshot shown on the repo Readme.
Take a look at the code and the commit history to see how it works.
thanks for the repo, but I had a few problems getting it to run... maybe too many to spend a lot of time on (i.e. I struggled with items in the /bin folder so I copied everything from another instance, and the formulate stuff from another site I was developing, I upgraded MySql and .NET, but it really got stuck because it didn't know what frm:Render was, or FormModel - probably needs a tagprefix in the web.config).
I had started to work my way through everything, but in the end, I thought my time would be better spent on, as you suggested, getting the MyPage.master option working.
Strange. I built this at home last night, then just tried cloning at work this morning and it worked perfectly. Are you using an older version of Visual Studio (e.g., Visual Studio 2013)? If so, it may not be running NuGet package restore. Visual Studio 2015 runs that automatically:
The "frm:Render" tag was defined at the top of the Home.master file:
FormModel is defined in RenderFormulateForm.ascx.cs:
In any event, if you've got something that works for you, happy to hear it. Let me know if you have any questions.
You are correct, I am using VS2013 and sorry, I didn't think to look Home.Master. In any case, the umbraco backoffice was giving me enough info so I could see what you were trying to achieve.
I'll see about getting me a copy of VS2015, and I'll try running it again.
After a little research, I found VS2013 has the exact same settings for NuGet.
I've got your example site up and running and received an email from the test form you created.
I've also marked your earlier post as the solution.
Many thanks for this, I really appreciate all the help you gave.
I'll make some amendments to the site I'm developing and try out Formulate there.
Awesome, happy to hear it seems to be working out so far. Let me know if you run across any more issues or have any more questions.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted