I would like to use BeginForm to send some data to the server to check them without reloading the page.
If my action is of type void i get a blank page, same when i use EmptyResult. Also tried with Html.BeginForm, same result.
Here's the Code:
view:
@using(Ajax.BeginForm("putData", "Home", null, new AjaxOptions {HttpMethod = "POST" }, new { target = "_self" }))
{
@Html.ValidationSummary(false)
<fieldset style="padding-bottom: 0" id="Settings">
<legend>Settings</legend>
....
<td width="180" align="right" class="noborder">
<button type="submit" id="checkButton">Check</button>
</td>
</tr>
</table>
</fieldset>
}
controller:
[HttpPost]
public EmptyResult putData(Settings settings)
{
...some checking and updating the model
return new EmptyResult();
}
Hope you guys can help me.