I have a page that contains multiple inputs - I'm using Ajax.BeginForm to build a form for each set of inputs.
<% using (Ajax.BeginForm(new AjaxOptions() { InsertionMode = InsertionMode.InsertAfter, HttpMethod = "POST" }))
{ %>
<input class="smallInput" type="text" name="duration"/>
<input type="submit" value="Add" />
<% } %>
The controller looks like this
[AcceptVerbs("POST")]
public ActionResult AddExercise(FormCollection form)
{
// some save logic...
return Content(string.Empty);
}
This works - the data is submitted to my controller and is saved.
However, every time this happens my page is replaced by a blank page. If I explicitly return a View from my Action, that view appears instead. But I want it to submit the form, leaving my existing page in place as-is.