title: Proper way to use AJAX Post in jquery to pass model from strongly typed MVC3 view
body: <p>I'm a novice web programmer so please forgive me if some of my "jargon" is not correct.
  I've got a project using ASP.NET using the MVC3 framework.  </p>
  
  <p>I am working on an admin view where the admin will modify a list of equipment.  One of the functions is an "update" button that I want to use jquery to dynamically edit the entry on the webpage after sending a post to the MVC controller.</p>
  
  <p>I presume this approach is "safe" in a single admin setting where there is minimal concern of the webpage getting out of sync with the database.</p>
  
  <p>I've created a view that is strongly typed and was hoping to pass the model data to the MVC control using an AJAX post.</p>
  
  <p>In the following post, I found something that is similar to what I am looking at doing:
  <a href="https://stackoverflow.com/questions/5698888/jquery-ajax-and-asp-net-mvc3-causing-null-parameters">JQuery Ajax and ASP.NET MVC3 causing null parameters</a></p>
  
  <p>I will use the code sample from the above post.</p>
  
  <p>Model:</p>
  
  <pre><code>public class AddressInfo 
  {
      public string Address1 { get; set; }
      public string Address2 { get; set; }
      public string City { get; set; }
      public string State { get; set; }
      public string ZipCode { get; set; }
      public string Country { get; set; }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public class HomeController : Controller
  {
      public ActionResult Index()
      {
          return View();
      }
  
      [HttpPost]
      public ActionResult Check(AddressInfo addressInfo)
      {
          return Json(new { success = true });
      }
  }
  </code></pre>
  
  <p>script in View:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var ai = {
      Address1: "423 Judy Road",
      Address2: "1001",
      City: "New York",
      State: "NY",
      ZipCode: "10301",
      Country: "USA"
  };
  
  $.ajax({
      url: '/home/check',
      type: 'POST',
      data: JSON.stringify(ai),
      contentType: 'application/json; charset=utf-8',
      success: function (data.success) {
          alert(data);
      },
      error: function () {
          alert("error");
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I have not had a chance to use the above yet.  But I was wondering if this was the "best" method to pass the model data back to the MVC control using AJAX?</p>
  
  <p>Should I be concerned about exposing the model information?</p>