More in this section

Pure MVC Form

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Ruth
    Ruth avatar
    25 posts
    Registered:
    17 May 2012
    03 Aug 2016
    Link to this post
    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.
1 posts, 0 answered