Pure MVC Form

Posted by Community Admin on 04-Aug-2018 09:23

Pure MVC Form

All Replies

Posted by Community Admin on 03-Aug-2016 00:00

Following a form post if my model is invalid how to I return the current page in order to display any errors?

I have an issue whereby I have a template with a widget on it. I have a page based on the template on which I have a widget containing a form. My widget controller actions are as follows:

public ActionResult Index()

return View("Index", new FormTestModel());


[HttpPost]
public ActionResult Index(FormTestModel model)

return View("Index", model);


And my view:

@using Telerik.Sitefinity.UI.MVC

@model SitefinityWebApp.Mvc.Models.FormTestModel
@using (Html.BeginFormSitefinity(true))

    @Html.TextBoxFor(m => m.Name)
    <button type="submit">submit</button>


When the form is submitted the post action fires but when I return it shows the original page but without the widget which is on the template.

This thread is closed