Copied to clipboard

Flag this post as spam?

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


  • Peter S 169 posts 587 karma points
    Aug 19, 2014 @ 10:09
    Peter S
    0

    Surface controller fails at post back

    I just created my first partial view using a surface controller. The view is rendered using Html.RenderAction and on it there is a form based on a model. The form is created using the standard @using (Html.Beginform()){...

    So far everything seems to work fine but when I click submit I get redirected to a path like umbraco/Surface/controller-name/view-name. Because of this the controller HttpPost is never fired and instead the model fires an exception on it's first line, public LoginModel() : base(UmbracoContext.Current.PublishedContentRequest.PublishedContent) { }.

    What am I doing wrong here? It feels like I'm missing something.

  • Peter S 169 posts 587 karma points
    Aug 19, 2014 @ 11:40
    Peter S
    100

    Turns out I had to use this Html.BeginUmbracoForm instad.

Please Sign in or register to post replies

Write your reply to:

Draft