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.
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.
Turns out I had to use this Html.BeginUmbracoForm instad.
is working on a reply...