title: get model object as json response asp net mvc 4
body: <p>What i want to achieve</p>
  
  <ul>
  <li>Initiate jQuery ajax get request if radio button is selected</li>
  <li>Retrieve Model object as json response with values</li>
  <li>Using that model object display data on razor view</li>
  </ul>
  
  <p><strong>I am stuck in third step.How can i use model object to display data on razor view</strong></p>
  
  <p><em>P.S. I am able to get alert as "Building No : 1" from my ajax code</em></p>
  
  <p>JS</p>
  
  <pre><code>$('input[name=PerAddress]').on('change', function () {
      if ($('input[name=PerAddress]:checked', '.form-group').val() == 'true') {       
          $.ajax({
              url: "CAD",
              type: 'GET',
              dataType: 'json',
              success: function (data) {
                  alert(data.PresentAddress1);
              },
              error: function (jqXHR, textStatus, errorThrown) {
                  alert(errorThrown);
              }
          });
      }
  });
  </code></pre>
  
  <p>Controller Action Method :</p>
  
  <pre><code>[HttpGet]
  [ActionName("CAD")]
  public JsonResult CustomerAddress()
  {
      var model = new AccountOpeningComplete
      {
          PresentAddress1 = "Building No : 1", // To be later retrieve from database
          PresentAddress2 = "Mumbai", // To be later retrieve from database
          PresentPostalCode = "497989", // To be later retrieve from database
          CityList = new SelectList(DataAccess.DAL.DropDownValues("City"), "Value", "Text"),
          ProvinceList = new SelectList(DataAccess.DAL.DropDownValues("Province"), "Value", "Text"),
          CountryList = new SelectList(DataAccess.DAL.DropDownValues("Country"), "Value", "Text")
      };
      return Json(model, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>Razor View</p>
  
  <pre><code>@Html.LabelFor(m =&gt; m.PresentAddress1, new { @class = "col-xs-6 col-md-3 control-label" })
  &lt;div class="col-xs-6 col-md-9"&gt;
      @Html.TextBoxFor(m =&gt; m.PresentAddress1, new { @class = "form-control" })
  &lt;/div&gt;
  </code></pre>