In 4.11 I was able to use the Html.BeginUmbracoForm extention method to render a form from a partial with a POST method. In V6.0.0 the method no longer seems to be extended from the Html object but I found it here:
using (Umbraco.Web.HtmlHelperRenderExtensions.BeginUmbracoForm(Html, "PartialName", "ControlerName"))
That generates the form but the method is a GET instead of the POST. Trying to pass the html attribute using the following doesn't work either:
using (Umbraco.Web.HtmlHelperRenderExtensions.BeginUmbracoForm(Html, "PartialName", "ControlerName", null, new { method="POST" }))
In the end I had to change the form method via javascript within the partial (not very clean). Any reason the BeginUmbracoForm method has changed to generate a form with a GET instead of a POST method?
BeginUmbracoForm does indeed extend the Html helper, double check that you have Umbraco.Web listed in your web.config file in the Views directory (or include a using statement). Regarding Get and Post, not sure - mine are rendering quite happily as POST.
I got the extention (Html.BeginUmbracoForm) to work with the using statement. Strange, I could have sworn I tried that. Thanks for bringing it to light though!
Regarding the form method, it's still defaulting the form to a GET method which is strange. I'll take another look later when I have time and hopefully I can remove the javascript changing the method.
BeginUmbracoForm Location and Method V6.0.0
In 4.11 I was able to use the Html.BeginUmbracoForm extention method to render a form from a partial with a POST method. In V6.0.0 the method no longer seems to be extended from the Html object but I found it here:
That generates the form but the method is a GET instead of the POST. Trying to pass the html attribute using the following doesn't work either:
In the end I had to change the form method via javascript within the partial (not very clean). Any reason the BeginUmbracoForm method has changed to generate a form with a GET instead of a POST method?
Thanks.
Hi James,
BeginUmbracoForm does indeed extend the Html helper, double check that you have Umbraco.Web listed in your web.config file in the Views directory (or include a using statement). Regarding Get and Post, not sure - mine are rendering quite happily as POST.
Hi Robert, thanks for the reply.
I got the extention (Html.BeginUmbracoForm) to work with the using statement. Strange, I could have sworn I tried that. Thanks for bringing it to light though!
Regarding the form method, it's still defaulting the form to a GET method which is strange. I'll take another look later when I have time and hopefully I can remove the javascript changing the method.
is working on a reply...