Copied to clipboard

Flag this post as spam?

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


  • Jeremy Garner 2 posts 54 karma points
    Aug 29, 2013 @ 13:37
    Jeremy Garner
    0

    UmbracoBeginForm POST doesn't hit surface controller action

    First, I've done some custom routing to include a plain MVC project in an area following this tutorial:

    http://blog.dampee.be/post/2013/03/29/Convert-MVC-application-to-Umbraco-v6-using-Custom-Routes.aspx

    I haven't been able to tell if the custom routing is affecting this.

    In the main Umbraco project, I've set up a surface controller to handle a POST action (a contact form) and a partial view that uses Html.BeginUmbracoForm to direct the form at my surface controller action.  As described in the documentation, this correctly renders my markup with a special input field that umbraco uses to find the correct action after submitting the form.  When I submit the form I can see that the form data is correctly posted and umbraco reloads the page without an error, but nothing happens... if debug and set a break point in the action it is never hit, and no email is delivered locally.

    I've checked and double checked that everything is named correctly, but because the routing is handled internally I can't figure out a way to see what is going wrong.  Any ideas where my data is going?  How can I see how the routing works?

  • Charles Afford 1163 posts 1709 karma points
    Aug 31, 2013 @ 14:06
    Charles Afford
    0

    Can you tell us the controller ans action names and also how you are making the post from the partial/view.  Charlie :)

  • Jeremy Garner 2 posts 54 karma points
    Sep 01, 2013 @ 08:56
    Jeremy Garner
    102

    Thanks for the reply.  Taking a break helped me spot the problem.  I was including form tags inside the Html.UmbracoBeginForm brackets so the special Umbraco hidden input was being rendered after the closing form tag.  Once I removed the form tags (they are added for you) it worked.

  • John Smith 6 posts 26 karma points
    Oct 17, 2016 @ 20:47
    John Smith
    0

    This had me going in circles for hours! Thanks for posting this - it saved me going mental!

  • Craig Cronin 304 posts 503 karma points
    Mar 12, 2015 @ 15:40
    Craig Cronin
    1

    Hi Jeremy,

    Just came across this post and saved me!!!!  I've been looking at this problem for about 5 hrs and couldn't spot internal form tags...Its been stressing me out when everything else looked fine.

  • Charles Afford 1163 posts 1709 karma points
    Mar 15, 2015 @ 18:10
    Charles Afford
    0

    Glad you got this sorted guys :)

Please Sign in or register to post replies

Write your reply to:

Draft