Copied to clipboard

Flag this post as spam?

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


  • James Borza 34 posts 95 karma points
    Feb 08, 2013 @ 18:22
    James Borza
    0

    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:

    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?

    Thanks.

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Feb 08, 2013 @ 18:48
    Robert Foster
    0

    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.

  • James Borza 34 posts 95 karma points
    Feb 08, 2013 @ 19:21
    James Borza
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft