title: return json object as a string in asp.net MVC
body: <p>I am trying to do an ajax call from my view where I return a json object from my controller.  However, when I try this I get the object type, but not the values as strings.  Here is my code..</p>
  
  <p>Controller</p>
  
  <pre><code>public class HomeController : Controller
  {
      //
      // GET: /Home/
  
      public ActionResult Index()
      {
          return View();
      }
  
      public ActionResult GetPerson()
      {
          var _model = _person;
          return Json(_model, JsonRequestBehavior.AllowGet);
      }
  
      static Person _person = new Person()
      {
          FirstName = "Steve",
          LastName = "Johnson",
          Age = 27
      };  
  }
  </code></pre>
  
  <p>View</p>
  
  <pre><code>@{
  Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta name="viewport" content="width=device-width" /&gt;
          &lt;title&gt;Index&lt;/title&gt;
          &lt;script src="~/Scripts/jquery-2.0.3.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div&gt;
              &lt;form&gt;
                  &lt;fieldset&gt;
                      &lt;legend&gt;The Person&lt;/legend&gt;
                      &lt;label&gt;Name: &lt;/label&gt;
                      &lt;input /&gt;
                      &lt;label&gt;Age: &lt;/label&gt;
  
                  &lt;/fieldset&gt;
  
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              $.ajax({
              url: '/Home/GetPerson',
              type: 'GET',
              success: function (result) { alert(result);}
          });
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>The alert box return [object Object].  I am trying to get the string values of the "Person" object.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks!</p>