Copied to clipboard

Flag this post as spam?

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


  • Serge 5 posts 95 karma points
    Jan 21, 2020 @ 11:22
    Serge
    0

    Html.BeginUmbracoForm Umbraco 8 Bug ?

    Hello community , didn't used umbraco since version 5 , but now i need to create a simple website with it.

    I have created a page , inside the template i have

     @Html.Partial("ContactFormPartial",new ContactFormViewModel())
    

    inside this partial view I have

    @using (Html.BeginUmbracoForm<ContactFormController>("SaveData",new {@class="contact-form" }, FormMethod.Post))
    

    Controller is inherited from SurfaceController. So I was expecting form action attribute to be rendered like /umbraco/sufrace/{contrl}/action , instead action attribute is set to

    <form action="/contact-us/" enctype="multipart/form-data" method="post"> 
    

    Current page of umbraco , and of course data cannot be submitted. Anyone faced with this kind of problem ?

  • Nik 1413 posts 6212 karma points MVP 3x c-trib
    Jan 21, 2020 @ 14:58
    Nik
    0

    Hi Serge,

    What you are seeing is actually correct. The routing happens via a hidden field on your form that Html.BeginUmbracoForm puts in. That is why you see the action url as the current page.

    What does your controller look like?

    Thanks

    Nik

  • Serge 5 posts 95 karma points
    Jan 22, 2020 @ 10:04
    Serge
    0

    Thanks , I've found the problem. The problem was totally unrelated to this.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies