Pure MVC Form - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Pure MVC Form

  • Pure MVC Form
  • 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.