You need to slightly modify the HtmlHelper BeginForm declaration so that the id attribute is rendered using this element:
@using (Html.BeginForm("Admin", "Home", FormMethod.Post, new { id = "well-form" }))
script , -- ( ).
<script>
$(function() {
$('#well-form').submit(function() {
$.ajax({
url: this.action,
type: this.method,
data: $(this).serialize(),
success: function(result) {
alert('Post was successful!');
},
error: function(result) {
alert('Post was not successful!');
}
});
return false;
});
});
</script>