I'm kind of new with umbraco and Mvc. As I understand for now is that Contour is still a ASP.NET WEb Forms usercontrol. Now i have added a contour form as part of a page by using the macro inside a richtext control (datatype). When i select the "next" button to the next step, the whole page is refreshed which is terrible. With my experrience from ASP.NET Web Forms I could just use a ajax updatepanel to fix this.
I found the thread http://our.umbraco.org/forum/umbraco-pro/contour/39209-Contour-Ajax-Post but I have no idea where en how I could use the Ajax.BeginForm. I thought I had to put it in the MvcRenderContourForm.chtml but this partial not seems to recognise the BeginForm (The namespace doesn't have it, do I have to add some references maybe?)
Can someone point me in the right direction to be able to use ajax to only partly do a postback (Which works for a umbraco 6 Mvc Razor website)?
I would suggest that you ask for some details in the post you are refering to, seems that Tom Martin has it working but I don't now what steps are needed...
I've been trying hard to get it working. Now it looks like i'm half way but i really don't understand how umbraco contour (or umbraco) routes the action result. It seems that it's returning the whole page instead of just a view with the form.
To exclude local problems i started a clean new umbraco 6.0.3 project and installed the standard website for mvc.. Replaced the body of the home with the form created with the fine description from Tom Martin. Still I get the following result.
I can't look/debug into the controllers (Or can I?) to confirm this. Looks like it will only work when the ajax target is outside the contour form. Unforunately I have a website with long pages. When the form is filled the page now gets refreshed with the result that the contourform gets out of sight and users need to scroll down to fill out the next step etc.. Thus, i really need ajax to render this form (Is this even supported, and if not, is it planned to become supported).
One of the strange things I noticed was that the action attribute of the form is empty.
I'm still using the unlicensed latest contour (3.0.9 at time of writing) but when the (new) site is ready to get published it will get a license. I really like the contour ease of use for some of our content editors and would really like to render the form with the use of ajax technology.
Any suggestions on what to do next, or am I thinking a totally wrong way?
I am having the same problem and I think that is because , controller for contour form returns a "view" not a "Partial view" thats why page is printed kind of twice. We only want the part of the page to be loaded without a pageload but controller returns the whole page:(
As far as I know we don't have any controll over controller to return a "partial view".
I have been to the mentioned page. What I am trying to achieve is using contour form as as comment system. So I have a Comment text field and under that I am listing all the comments related to that page.
Originally there is a Html.BeginForm which works great so the comment is being saved in the database and apperears in the commet list. But this refreshes the page and I want only the div containing the comments to be refreshed.
So what I did was just to change Html.BeginForm to Ajax.BeginForm and in ajax options I gave the id of the div containing comments to be replaced in "UpdateTargetId".
And then there is a whole page rendered in the my page cso I have double header etc:(
I am quite new to umbraco and even newer to mvc so if I am making some stupid mistake then forgive me :)
just wondering where the Ajax.BeginForm needs to live as there's no complete example I can find? where did the umbracocontour.renderrazorform macro get generated?
Rendering contour forms using ajax
Hello,
I'm kind of new with umbraco and Mvc. As I understand for now is that Contour is still a ASP.NET WEb Forms usercontrol. Now i have added a contour form as part of a page by using the macro inside a richtext control (datatype). When i select the "next" button to the next step, the whole page is refreshed which is terrible. With my experrience from ASP.NET Web Forms I could just use a ajax updatepanel to fix this.
I found the thread http://our.umbraco.org/forum/umbraco-pro/contour/39209-Contour-Ajax-Post but I have no idea where en how I could use the Ajax.BeginForm. I thought I had to put it in the MvcRenderContourForm.chtml but this partial not seems to recognise the BeginForm (The namespace doesn't have it, do I have to add some references maybe?)
Can someone point me in the right direction to be able to use ajax to only partly do a postback (Which works for a umbraco 6 Mvc Razor website)?
Comment author was deleted
Hey,
I would suggest that you ask for some details in the post you are refering to, seems that Tom Martin has it working but I don't now what steps are needed...
I've been trying hard to get it working. Now it looks like i'm half way but i really don't understand how umbraco contour (or umbraco) routes the action result. It seems that it's returning the whole page instead of just a view with the form.
To exclude local problems i started a clean new umbraco 6.0.3 project and installed the standard website for mvc.. Replaced the body of the home with the form created with the fine description from Tom Martin. Still I get the following result.
I can't look/debug into the controllers (Or can I?) to confirm this. Looks like it will only work when the ajax target is outside the contour form. Unforunately I have a website with long pages. When the form is filled the page now gets refreshed with the result that the contourform gets out of sight and users need to scroll down to fill out the next step etc.. Thus, i really need ajax to render this form (Is this even supported, and if not, is it planned to become supported).
One of the strange things I noticed was that the action attribute of the form is empty.
I'm still using the unlicensed latest contour (3.0.9 at time of writing) but when the (new) site is ready to get published it will get a license. I really like the contour ease of use for some of our content editors and would really like to render the form with the use of ajax technology.
Any suggestions on what to do next, or am I thinking a totally wrong way?
Comment author was deleted
And have you tried with a single step form? To see how that behaves
Same result after submit button and single Step:
Hi ID,
I am having the same problem and I think that is because , controller for contour form returns a "view" not a "Partial view" thats why page is printed kind of twice. We only want the part of the page to be loaded without a pageload but controller returns the whole page:(
As far as I know we don't have any controll over controller to return a "partial view".
If you find any solution do let me know :)
Comment author was deleted
The Contour controller only returns partial views so that can't be it, have you tried the instructions described in http://our.umbraco.org/forum/umbraco-pro/contour/39209-Contour-Ajax-Post ?
I have been to the mentioned page.
What I am trying to achieve is using contour form as as comment system. So I have a Comment text field and under that I am listing all the comments related to that page.
Originally there is a Html.BeginForm which works great so the comment is being saved in the database and apperears in the commet list. But this refreshes the page and I want only the div containing the comments to be refreshed.
So what I did was just to change Html.BeginForm to Ajax.BeginForm and in ajax options I gave the id of the div containing comments to be replaced in "UpdateTargetId".
And then there is a whole page rendered in the my page cso I have double header etc:(
I am quite new to umbraco and even newer to mvc so if I am making some stupid mistake then forgive me :)
Comment author was deleted
Yeah haven't tried it myself but will give it a go and see if I can reproduce
Thanks Tim For a quick reply :)
Comment author was deleted
I can reproduce the issue but not sure why it happens
As a workaround you can set an id on your body and use that on your UpdateTargetId that appears to work
So my test template looks like
And the ajax form
just wondering where the Ajax.BeginForm needs to live as there's no complete example I can find? where did the umbracocontour.renderrazorform macro get generated?
is working on a reply...