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 1614 posts 7260 karma points MVP 7x 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.

  • Declercq Pascal 8 posts 77 karma points
    Nov 26, 2021 @ 07:11
    Declercq Pascal
    0

    I have exactly the same problem but in V9. Can you share your solution?

Please Sign in or register to post replies

Write your reply to:

Draft