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());
public ActionResult Index(FormTestModel model)
return View("Index", model);
And my view:
@Html.TextBoxFor(m => m.Name)
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.