@model HelloWorldMvcApp.Person
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
.field-validation-error {
<div class="col-md-6 col-md-offset-3">
@using (Html.BeginForm())
@Html.LabelFor(m => m.FirstName)
@Html.TextBoxFor(model => model.FirstName, new {@class="form-control"})
@Html.ValidationMessageFor(model => model.FirstName)
@Html.LabelFor(m => m.LastName)
@Html.TextBoxFor(model => model.LastName, new {@class="form-control"})
@Html.ValidationMessageFor(model => model.LastName)
<button type="button" class="btn btn-success submit">Submit</button>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script src="//ajax.aspnetcdn.com/ajax/mvc/4.0/jquery.validate.unobtrusive.min.js"></script>
<script type="text/javascript">
$('.submit').click(function(){
url: '@Url.RouteUrl(new{ action="GetPerson", controller="Home"})',
data: {FirstName: $('#FirstName').val(), LastName: $('#LastName').val()},
contentType: "application/json; charset=utf-8",
success: function(resp) {
$('#result').html("Error: Please fill out all the details");